包的下载相关小问题

包的下载方式

1.pycharm编译器直接下载
Settings -> Project Settings -> Python interpreter


image.png

2.命令行下载: pip install package-name -i https://国内地址

pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple

出现的问题
ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
ERROR: No matching distribution found for numpy

解决方法:除了添加镜像地址外,还要信任此地址
C:\Users\Administrator>pip install numpy -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/
Collecting numpy
  Downloading http://pypi.doubanio.com/packages/bf/8c/3d36cef521739bd481e9a5b30e5c0f9faf8b7fe7b904238368908a9d149d/numpy-1.24.2-cp38-cp38-win_amd64.whl (14.9 MB)
     ---------------------------------------- 14.9/14.9 MB 10.1 MB/s eta 0:00:00
Installing collected packages: numpy
Successfully installed numpy-1.24.2

关于preject interpreter的镜像功能

https://blog.csdn.net/qq_41498261/article/details/109112331
所以呢,创建项目时,一定要继承base interpreter的所有包(视具体情况啦,自己重新下载一样的)

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容