1
votes

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.

  1. 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

  2. I tried pip3:

    sudo pip3 install selenium

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

  3. 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

  4. 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?

2
Looks like your system is broken (unsurprisingly, taking into account some of things you did). Though things in the answers and in your comments will break that even more.wRAR

2 Answers

0
votes

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

0
votes

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.