Why pip3 install in python2 sitepackages

后端 未结 3 523
野性不改
野性不改 2020-12-06 05:49

First I use

Python 3.6.5
Python 2.7.14
and mac.

In my case, I just download module like numpy(for example, and other\'s same)

3条回答
  •  执笔经年
    2020-12-06 06:12

    It seems that pip3 refers to Python-2.7's pip module or any other version of Python-3 that you have installed on your machine. However, you can install packages directly using the intended Python version. You'd need to just use -m option.

    python3.6 -m pip install numpy
    

    Another option is to changing the source path that pip3 refers to. You can do this by finding the path of Python-3.6's pip and just bind it to pip3 alias.

提交回复
热议问题