pip安装包报错Could not find a version that satisfies the requirement gym (from versions: none)

博主使用的编译环境:Anaconda 3 ,python3.8,tensorflow2.3.0

当我使用python自带的pip安装一些包时,总是会报以下错误:

第一种可能:

我们需要对pip命令升级:执行命令如下:

python -m pip install --upgrade pip

仍然报错,说明问题不是因为pip版本:

第二种可能:

 更换一个镜像源,在pip install XXX命令的后面加上以下命令

--default-timeout=100 -i https://pypi.tuna.tsinghua.edu.cn/simple

 附上pip国内的一些镜像:

阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中科大 http://pypi.mirrors.ustc.edu.cn/simple/

  这时终端可能提示,输入的镜像源没有得到信任,这时是无法用的。有两个解决方法:

  方法一:直接在终端中输入以下指令,这是为了获得ssl证书的认证

--trusted-host pypi.douban.com(此处输入你想更换的镜像源地址)
pip install 包名-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

  方法二:找到pip的配置文件添加信任源,根据下面地址找到pip.ini文件然后打开该文件,添加一    行代码:

trusted-host=pypi.douban.com

 以上两个方法都可以成功使用豆瓣源进行下载

 安装成功!

 最后可以在终端输入pip list 查看在当前环境下载的库

(tensorflow) PS C:\Users\86153> pip list
Package                      Version
---------------------------- -------------------
absl-py                      0.15.0
altgraph                     0.17.2
astor                        0.8.1
astunparse                   1.6.3
blinker                      1.4
boto3                        1.20.24
botocore                     1.23.24
brotlipy                     0.7.0
cachetools                   5.0.0
certifi                      2021.10.8
cffi                         1.15.0
charset-normalizer           2.0.4
click                        8.0.3
cloudpickle                  2.0.0
cryptography                 3.4.8
cycler                       0.11.0
distlib                      0.3.4
filelock                     3.6.0
flatbuffers                  2.0
future                       0.18.2
gast                         0.4.0
google-auth                  2.6.2
google-auth-oauthlib         0.4.6
google-pasta                 0.2.0
grpcio                       1.42.0
gym                          0.23.1
gym-notices                  0.0.6
h5py                         2.10.0
idna                         3.3
importlib-metadata           4.11.3
jmespath                     0.10.0
joblib                       1.1.0
jupyter-tensorboard          0.2.0
keras                        2.8.0
Keras-Applications           1.0.8
Keras-Preprocessing          1.1.2
kiwisolver                   1.4.2
libclang                     13.0.0
Markdown                     3.3.6
matplotlib                   3.3.4
mkl-fft                      1.3.1
mkl-random                   1.2.2
mkl-service                  2.4.0
numpy                        1.21.5
oauthlib                     3.2.0
opt-einsum                   3.3.0
pandas                       1.4.2
pefile                       2021.9.3
Pillow                       9.1.0
pip                          22.0.4
pipenv                       2022.4.8
platformdirs                 2.5.1
protobuf                     3.19.1
pyasn1                       0.4.8
pyasn1-modules               0.2.8
pycparser                    2.21
pyinstaller                  4.10
pyinstaller-hooks-contrib    2022.3
PyJWT                        2.1.0
pyOpenSSL                    21.0.0
pyparsing                    3.0.7
pyreadline                   2.1
PySocks                      1.7.1
python-dateutil              2.8.2
pythonnet                    2.5.2
pytz                         2022.1
pywin32-ctypes               0.2.0
PyYAML                       6.0
regex                        2022.3.15
requests                     2.27.1
requests-oauthlib            1.3.1
rsa                          4.7.2
s3transfer                   0.5.0
sacremoses                   0.0.43
scipy                        1.7.3
setuptools                   58.0.4
six                          1.16.0
tensorboard                  2.8.0
tensorboard-data-server      0.6.1
tensorboard-plugin-wit       1.6.0
tensorflow                   2.3.0
tensorflow-estimator         2.6.0
tensorflow-io-gcs-filesystem 0.24.0
termcolor                    1.1.0
tf-estimator-nightly         2.8.0.dev2021122109
tqdm                         4.62.3
transformers                 2.1.1
typing_extensions            4.1.1
urllib3                      1.26.8
virtualenv                   20.14.1
virtualenv-clone             0.5.7
Werkzeug                     2.0.3
wheel                        0.37.1
win-inet-pton                1.1.0
wincertstore                 0.2
wrapt                        1.13.3
zipp                         3.7.0

来源:努力写代码的小梁

物联沃分享整理
物联沃-IOTWORD物联网 » pip安装包报错Could not find a version that satisfies the requirement gym (from versions: none)

发表评论