Ubuntu: pip not working with python3.4

后端 未结 4 1314
余生分开走
余生分开走 2021-02-01 03:55

Trying to get pip working on my Ubuntu pc. pip seems to be working for python2.7, but not for others.

Here\'s the problem:

$ pip
Traceback (most recent c         


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-01 04:24

    You have pip installed for python 2, but not python 3.

    Ubuntu distributes python-pip, python3-pip, python-setuptools and python3-setuptools packages, which you can install (apt-get install etc) as necessary. Thereafter, note that pip installs for python 2, and pip3 installs for python 3 (similar to python, and python3).

    Setuptools could be said to provide python's "build" process for packages, and Pip provides its "install" process. Usually you want both present.

    If you want the very latest pip / setuptools, you could always get it from PyPA's bootstrap site:

    $ curl https://bootstrap.pypa.io/get-pip.py | python3.4
    

    Afterwards you can install the latest setuptools for the appropriate python, e.g

    $ python{2.7,3.4} -m pip install -U setuptools
    

    If you try to install these for the system python, you might need root / sudo.

提交回复
热议问题