Pip Install not installing into correct directory?

前端 未结 10 1106
小蘑菇
小蘑菇 2020-11-29 04:22

I can\'t seem to use sudo pip install correctly so that it installs into the following directory:

/Library/Frameworks/Python.framework/Versions/2.7/lib/pyth         


        
10条回答
  •  悲哀的现实
    2020-11-29 04:30

    From the comments to the original question, it seems that you have multiple versions of python installed and that pip just goes to the wrong version.

    First, to know which version of python you're using, just type which python. You should either see:

    which python
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python
    

    if you're going to the right version of python, or:

    which python
    /usr/bin/python
    

    If you're going to the 'wrong' version. To make pip go to the right version, you first have to change the path:

     export PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin/python:${PATH}
    

    typing 'which python' would now get you to the right result. Next, install pip (if it's not already installed for this installation of python). Finally, use it. you should be fine now.

提交回复
热议问题