Win10 安装gym遇到的问题记录

首先需要安装anaconda,直接在官网安装即可

  • 终端输入conda显示以下信息即为安装成功,如果安装好还是显示conda是外部命令这种字样,则是需要配置环境变量。Win10 安装gym遇到的问题记录_第1张图片

创建新的环境gym(名字自定),记得指明python版本

conda install -n gym python=3.7

激活环境

activate gym

 在gym环境中安装gym包,这里遇到了很多错误,

  • 直接pip install可能会比较慢,用一些镜像的源会快些,于是一开始使用如下命令安装:
    pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple gym

    报错:

    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))': /whl/torch_stable.html
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))': /whl/torch_stable.html
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))': /whl/torch_stable.html
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))': /whl/torch_stable.html
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))': /whl/torch_stable.html
    Could not fetch URL https://download.pytorch.org/whl/torch_stable.html: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='download.pytorch.org', port=443): Max retries exceeded with url: /whl/torch_stable.html (Caused by SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))) - skipping
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))': /simple/torch/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))': /simple/torch/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))': /simple/torch/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))': /simple/torch/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))': /simple/torch/
    Could not fetch URL https://pypi.org/simple/torch/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/torch/ (Caused by SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))) - skipping
    ERROR: Could not find a version that satisfies the requirement torch==1.3.1 (from versions: none)
    ERROR: No matching distribution found for torch==1.3.1
    Could not fetch URL https://download.pytorch.org/whl/torch_stable.html: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='download.pytorch.org', port=443): Max retries exceeded with url: /whl/torch_stable.html (Caused by SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))) - skipping
    Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1091)'))) - skipping

  •  换了一个源,发现还是不行,报了一样的错
    pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple gym
  •  加上“--trusted-host”之后,安装其他的包可以执行了
    pip install pywinauto -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

    Win10 安装gym遇到的问题记录_第2张图片

     但是安装gym还是不行,报错:

    WARNING: The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host pypi.douban.com'.
    ERROR: Could not find a version that satisfies the requirement gym (from versions: none)
    ERROR: No matching distribution found for gym

     

    Win10 安装gym遇到的问题记录_第3张图片

  •  警告信息中说建议用https,于是把镜像源发http改为https,还是报第一次一样的错。
    Win10 安装gym遇到的问题记录_第4张图片
  •  最后发现是因为开了代理才导致一直不被信任,关闭代理之后,成功!
    pip install gym -i https://pypi.douban.com/simple --trusted-host pypi.douban.coman.com

    Win10 安装gym遇到的问题记录_第5张图片

  • 测试一下:打开python,import gym,成功啦!
     Win10 安装gym遇到的问题记录_第6张图片

 

  • 坠吼附上一些查到的国内可用的源:
    中国科学技术大学: http://pypi.mirrors.ustc.edu.cn/simple/
    清华大学: https://pypi.tuna.tsinghua.edu.cn/simple/
    阿里云: https://mirrors.aliyun.com/pypi/simple/
    豆瓣: http://pypi.douban.com/simple/
    
     

你可能感兴趣的:(强化学习,python,开发语言,windows)