仅记录一下自己离线下载安装包时遇到的奇奇怪怪的问题
1、下载离线包网址
https://pypi.org/
2、查看版本信息
tensorflow-2.2.1-cp36-cp36m-manylinux2010_x86_64.whl is not a supported wheel on this platform.
可以用下面方法查看自己所需的版本
#进入python
python
>>> import pip._internal.pep425tags
>>> print(pip._internal.pep425tags.get_supported())
直接把文件的名字改成tensorflow-2.2.1-cp36-cp36m-manylinux1_x86_64.whl就可以了(简单暴力且有效)
3、安装包
在文件目录下新建一个文件,里面都放离线包就行,然后命令进入这个包(我的叫test)
cd test
如果是whl文件,直接输入以下命令就行(我的离线包文件就叫test,根据你的文件改一下哦)
pip install --no-index --find-link =/你的文件名 包名.whl
#举例
pip install --no-index --find-link =/test nltk-3.8.1-py3-none-any.whl
如果是.tar.gz文件,下载解压之后,再放到离线包文件夹里
命令进入到这个文件夹,直接运行里面的setup.py文件就可以了
cd test
cd wrapt-1.12.0
python setup.py install
4、遇到以下问题,就是说你还缺了其他包(opt-einsum>=2.3.2),慢慢装就可以了
Could not find a version that satisfies the requirement opt-einsum>=2.3.2 (from tensorflow==2.2.1) (from versions: ) No matching distribution found for opt-einsum>=2.3.2 (from tensorflow==2.2.1)
5、pip uninstall 失败
Cannot uninstall 'Markdown'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
#查看自己的文件在哪里
pip show Markdown
Location: /opt/conda/lib/python3.6/site-packages
根据location的地址把里面的文件删了就可以了