简体   繁体   中英

How to install a custom OpenAI Gym environment on a server with no internet connection

I am trying to install a custom OpenAI gym environment on a remote machine that has no internet.

I transferred all the files from the master node to the remote machine.

Then tried to install the gym environment as follows:

(tf-gpu) [username@localhost gym-CartPole-bt-v0]$ pip install -e .
Obtaining file:///home/username/code/openai/gym-CartPole-bt-v0
Requirement already satisfied: gym in /home/username/miniconda3/envs/tf-gpu/lib/python3.7/site-packages (from gym-CartPole-BT==0.0.1) (0.16.0)
Requirement already satisfied: pyglet<=1.5.0,>=1.4.0 in /home/username/miniconda3/envs/tf-gpu/lib/python3.7/site-packages (from gym->gym-CartPole-BT==0.0.1) (1.4.10)
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f6acfdc9b50>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/cloudpickle/

...

ERROR: Could not find a version that satisfies the requirement cloudpickle~=1.2.0 (from gym->gym-CartPole-BT==0.0.1) (from versions: none)
ERROR: No matching distribution found for cloudpickle~=1.2.0 (from gym->gym-CartPole-BT==0.0.1)

I am not sure what cloudpickle is or why it needs to access the internet during this process.

But I did check and I have a more recent version of cloudpickle installed:

$ conda list
# packages in environment at /home/username/miniconda3/envs/tf-gpu:
#
# Name                    Version                   Build  Channel
...
cloudpickle               1.3.0                    pypi_0    pypi
...

Can anyone explain what is going on here and any ideas to resolve it?

I went back to the master node and ran the following command and it seemed to change the cloudpickle version back:

(tf-gpu) [username@hostname gym-CartPole-bt-v0]$ pip install gym
Requirement already satisfied: gym in /home/username/miniconda3/envs/tf-gpu/lib/python3.7/site-packages (0.16.0)
Requirement already satisfied: numpy>=1.10.4 in /home/username/miniconda3/envs/tf-gpu/lib/python3.7/site-packages (from gym) (1.18.1)
Requirement already satisfied: pyglet<=1.5.0,>=1.4.0 in /home/username/miniconda3/envs/tf-gpu/lib/python3.7/site-packages (from gym) (1.4.10)
Requirement already satisfied: six in /home/username/miniconda3/envs/tf-gpu/lib/python3.7/site-packages (from gym) (1.14.0)
Collecting cloudpickle~=1.2.0
  Using cached cloudpickle-1.2.2-py2.py3-none-any.whl (25 kB)
Requirement already satisfied: scipy in /home/username/miniconda3/envs/tf-gpu/lib/python3.7/site-packages (from gym) (1.4.1)
Requirement already satisfied: future in /home/username/miniconda3/envs/tf-gpu/lib/python3.7/site-packages (from pyglet<=1.5.0,>=1.4.0->gym) (0.18.2)
Installing collected packages: cloudpickle
  Attempting uninstall: cloudpickle
    Found existing installation: cloudpickle 1.3.0
    Uninstalling cloudpickle-1.3.0:
      Successfully uninstalled cloudpickle-1.3.0
Successfully installed cloudpickle-1.2.2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM