jinzishuai / learn2deeplearn

A repository of codes in learning deep learning
GNU General Public License v3.0
13 stars 1 forks source link

Problem Running Sample OpenAI Gpy CartPole Random Code: RequestsDependencyWarning #39

Open jinzishuai opened 6 years ago

jinzishuai commented 6 years ago

Code

seki@seki-VirtualBox:~/src/learn2deeplearn/learnRL/CartPole$ cat cp_random.py 
#!/usr/bin/python2.7
import gym
env = gym.make('CartPole-v0')
env.reset()
for _ in range(1000):
    env.render()
    env.step(env.action_space.sample()) # take a random action

Run the Code

seki@seki-VirtualBox:~/src/learn2deeplearn/learnRL/CartPole$ ./cp_random.py 
/usr/local/lib/python2.7/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn't match a supported version!
  RequestsDependencyWarning)
No handlers could be found for logger "gym.envs.classic_control.cartpole"
jinzishuai commented 6 years ago

This is actually not a failure. Tried urblib3-1.13.1 and that is actually failing to run:

seki@seki-VirtualBox:~/src/learn2deeplearn/learnRL/CartPole$ ./cp_random.py 
/usr/local/lib/python2.7/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.13.1) or chardet (2.3.0) doesn't match a supported version!
  RequestsDependencyWarning)
Traceback (most recent call last):
  File "./cp_random.py", line 2, in <module>
    import gym
  File "/usr/local/lib/python2.7/dist-packages/gym/__init__.py", line 26, in <module>
    sanity_check_dependencies()
  File "/usr/local/lib/python2.7/dist-packages/gym/__init__.py", line 17, in sanity_check_dependencies
    import requests
  File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 90, in <module>
    from urllib3.exceptions import DependencyWarning
ImportError: cannot import name DependencyWarning