Ask: I can't install or upgrade any lib for python 3.4 because pip, pip3, pip3.4 not working or connected to python2.7.
I tried to set alias python=python3 and use just pip:
sudo pip install selenium
Requirement already satisfied (use --upgrade to upgrade): selenium in /usr/local/lib/python2.7/dist-packages
I tried pip3:
sudo pip3 install selenium
Requirement already satisfied (use --upgrade to upgrade): selenium in /usr/local/lib/python2.7/dist-packages
I tried pip3.4:
sudo pip3.4 install selenium
Requirement already satisfied (use --upgrade to upgrade): selenium in /usr/local/lib/python2.7/dist-packages
I tried to create venv for python3.4:
volodka@interceptor:/usr/bin$ sudo virtualenv -p /usr/bin/python3.4 python3env Running virtualenv with interpreter /usr/bin/python3.4 Using base prefix '/usr' New python executable in python3env/bin/python3.4 Also creating executable in python3env/bin/python Installing setuptools, pip, wheel...done.
volodka@interceptor:/usr/bin/python3env/bin$ . activate
(python3env)volodka@interceptor:/usr/bin/python3env/bin$ sudo pip install selenium Requirement already satisfied (use --upgrade to upgrade): selenium in /usr/local/lib/python2.7/dist-packages
Pip3, pip3.4 in virtualenv also try to install lib for python2.7. What I'm doing wrong?
The approach you should take is to install pip for Python 3.4
.
You do this in the following way:
$ curl -O https://bootstrap.pypa.io/get-pip.py
$ sudo python3.4 get-pip.py
You then install things for Python 3.4 with pip3.4, and you install things with Python 2-7 with pip-2.7.
Check /usr/bin
to see which pip versions you have there.
This is perhaps not the best solution. Having the same issue on Fedora 22, I managed to install python3 packages using pip this way: sudo pip3 install --install-option="--prefix=/usr/lib/python3.4/site-packages" package_name
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.