我正在尝试在pip的帮助下安装完整的openAI gym库(用于开发和比较强化学习算法的工具包)。但我一次又一次地得到同样的错误。我已经尝试过我在网上找到的所有东西来解决这个问题,但是无法做到。我帮助我找到了解决方法。 这是我的代码---
mukesh@mukesh-Inspiron-5558:~/gym$ sudo pip install -e .[all]
The directory '/home/mukesh/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/mukesh/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Obtaining file:///home/mukesh/gym
Requirement already satisfied: numpy>=1.10.4 in /home/mukesh/.local/lib/python2.7/site-packages (from gym==0.7.3)
Requirement already satisfied: requests>=2.0 in /home/mukesh/.local/lib/python2.7/site-packages (from gym==0.7.3)
Requirement already satisfied: six in /home/mukesh/.local/lib/python2.7/site-packages (from gym==0.7.3)
Requirement already satisfied: pyglet>=1.2.0 in /home/mukesh/.local/lib/python2.7/site-packages (from gym==0.7.3)
Requirement already satisfied: PyOpenGL in /usr/lib/python2.7/dist-packages (from gym==0.7.3)
Collecting box2d-py (from gym==0.7.3)
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/box2d-py/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/box2d-py/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/box2d-py/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/box2d-py/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/box2d-py/
Could not find a version that satisfies the requirement box2d-py (from gym==0.7.3) (from versions: )
No matching distribution found for box2d-py (from gym==0.7.3)
答案 0 :(得分:0)
您在代理服务器后面,因此您需要设置pip以便它使用您的代理服务器。基本格式为以下形式:
[user:passwd@]proxy.server:port
例如:
pip --proxy http://<your proxy>:<your port> (for http)
pip --proxy https://<your proxy>:<your port> (for https)