我通常使用anaconda作为我的主要python ide。我正在工作的项目需要谷歌的ortools,这是不可用的蟒蛇。我决定使用vs code和python 3.8.2来编写软件。我遇到的问题是,我不能为我的项目安装所需的模块到这个新的解释器。当我运行'pip install -U googlemaps'时,我得到:
要求已经满足:googlemaps在/Users/boss/opt/anaconda3/lib/python3.7/site-packages (4.4.2)要求已经满足:requests<3.0,>=2.20.0 in/Users/boss/opt/anaconda3/lib/python3.7/site-packages (from googlemaps) (2.22.0)要求已满足:certificate>=2017.4.17 in/Users/boss/opt/anaconda3/lib/python3.7/site-packages (from requests<3.0,>=2.20.0->googlemaps) (2019.9.11)要求已经满足:urllib3!=1.25.0,!=1.25.1,> 1.26,>=1.21.1在/Users/boss/opt/anaconda3/lib/python3.7/site-packages (from requests<3.0,>=2.20.0->googlemaps) (1.24.2)要求已经满足:chardet<3.1.0,>=3.0.2在/Users/boss/opt/anaconda3/lib/python3.7/site-packages (from requests<3.0,>=2.20.0->googlemaps) (3.0.4)要求已满足:idna<2.9,>=2.5 in/Users/boss/opt/anaconda3/lib/python3.7/site-packages (from requests<3.0,>=2.20.0->googlemaps) (2.8)
似乎安装想要默认为anaconda,但我不希望这样。我的新解释器的文件路径是:/usr/bin/python3 .
如何更改pip安装位置以转到所需的解释器?
所以解释器应该总是在/usr/bin/python3
.
如果你的解释器路径是,比如说,/home/foo/vsstudio/bin/python3
通过在BASH
/home/foo/vsstudio/bin/python3 -m pip install [YOUR PACKAGE]
容易吗?