S
S
Spasley2015-06-23 12:53:17
Python
Spasley, 2015-06-23 12:53:17

Why does pip install always for python2.7 in all versions?

When trying to install any libs on a freshly installed Ubuntu 14.04 LTS, pip keeps doing it for the 2.7 version of python with an error

Requirement already satisfied (use --upgrade to upgrade): selenium in /usr/local/lib/python2.7/dist-packages

I tried: set alias python=python3, pip, pip3, pip3.4, reinstall pip via get-pip.py, same result. After reinstalling pip, it turned out only to update / download the necessary libs through the pycharm package manager.
Do I need some sort of extract or environment variable?
This is my stackoverflow question (so far unanswered)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yuri Shikanov, 2015-06-23
@dizballanze

sudo apt-get install python3 python-pip python3-pip
sudo pip install <something> # для 2.7
sudo pip3 install <something> # для 3

and in general use virtualenv:
sudo apt-get install python-virtualenv
virtualenv -p python3 --no-site-packages venv
source venv/bin/activate
pip install <something>

V
Vov Vov, 2015-06-24
@balamut108

The answer is very simple: by default, Ubuntu uses version 2.7, resp. pip is set to 2.7, if you rearrange Python to 3 in Ubuntu, then pip will be under the 3rd Python and everything will be good.

A
Artem, 2015-06-25
@ulkoart

Duc, so the version of python in the system is 2.7, I advise you to get acquainted with the virtual environment.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question