美文网首页
更改Python的pip install 默认使用的pip库及默

更改Python的pip install 默认使用的pip库及默

作者: xianling_he | 来源:发表于2020-05-10 21:57 被阅读0次
  • Win系统下面安装了2个版本的python
  • 因为之前python3.7已经安装了很多有关tar包,已经有项目在使用
  • 需要切换更高的版本python3.8使用,这样又需要重新下载tar包到scripts文件夹下面

其实如果遇到多版本python需要切换的话,建议使用virtualEnv的方法,我在之前的帖子已经写过。

更改python默认的pip install默认使用pip库

  • 打开终端并查看当前pip包存放路径
pip show pip
image.png
  • 主要是Script文件夹需要在Path中靠前位置


    image.png
image.png

更改Python的pip install默认安装路径

  • 查看site.py文件路径
python -m site -help
image.png
  • 打开site.py并修改USER_BASE 和 USER_SITE
    USER_BASE: 用户自定义安装依赖包路径
    USER_SITE: 用户自定义启用Python脚本路径
image.png

安装库文件并进行验证

pip install wheel
image.png image.png
python -m site
image.png

相关文章

网友评论

      本文标题:更改Python的pip install 默认使用的pip库及默

      本文链接:https://www.haomeiwen.com/subject/thbsnhtx.html