HighwayEnv: Errors while setting up

Hi Eleurent,

Thanks for the amazing repository.

When I was trying to build the project, I ended up in below errors could you please help me to fix.

  1. install with Python3 br /> When I try with pip3 install --user git+https://github.com/eleurent/highway-env I am getting the below error and installation is not successful.
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-sir6pe48/matplotlib/
  1. When I try pip install --user git+https://github.com/eleurent/highway-env (which does the installation on Python2.7) installation is successful. However I am not able to import the highway_env
Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import highway_env
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kishor/.local/lib/python2.7/site-packages/highway_env/__init__.py", line 2, in <module>
    import highway_env.envs
  File "/home/kishor/.local/lib/python2.7/site-packages/highway_env/envs/__init__.py", line 1, in <module>
    from highway_env.envs.highway_env import *
ImportError: No module named envs.highway_env
>>> 

Thank you.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15

Most upvoted comments

By the way, if you have specific needs regarding the observation/action space, feel free to implement your own and create a pull request šŸ˜‰

error message makes me think there is something wrong with matplotlib. Is it installed on your python3 ? you can either use pip3 install matplotlib or apt install python3-matplotlib

Hi @kk2491

  1. I just tried it and could not reproduce the issue:
pip3 install --user git+https://github.com/eleurent/highway-env
Collecting git+https://github.com/eleurent/highway-env
  Cloning https://github.com/eleurent/highway-env to /tmp/pip-o35egi6o-build
Requirement already satisfied: gym in /usr/local/lib/python3.6/dist-packages (from highway-env==1.0.dev0)
Requirement already satisfied: numpy in ./.local/lib/python3.6/site-packages (from highway-env==1.0.dev0)
Requirement already satisfied: pygame in /usr/local/lib/python3.6/dist-packages (from highway-env==1.0.dev0)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.6/dist-packages (from highway-env==1.0.dev0)
Requirement already satisfied: pandas in /usr/local/lib/python3.6/dist-packages (from highway-env==1.0.dev0)
Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from gym->highway-env==1.0.dev0)
Requirement already satisfied: pyglet>=1.2.0 in /usr/local/lib/python3.6/dist-packages (from gym->highway-env==1.0.dev0)
Requirement already satisfied: requests>=2.0 in ./.local/lib/python3.6/site-packages (from gym->highway-env==1.0.dev0)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->highway-env==1.0.dev0)
Requirement already satisfied: pytz in ./.local/lib/python3.6/site-packages (from matplotlib->highway-env==1.0.dev0)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->highway-env==1.0.dev0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in ./.local/lib/python3.6/site-packages (from matplotlib->highway-env==1.0.dev0)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/dist-packages (from matplotlib->highway-env==1.0.dev0)
Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from pyglet>=1.2.0->gym->highway-env==1.0.dev0)
Requirement already satisfied: idna<2.8,>=2.5 in ./.local/lib/python3.6/site-packages (from requests>=2.0->gym->highway-env==1.0.dev0)
Requirement already satisfied: certifi>=2017.4.17 in ./.local/lib/python3.6/site-packages (from requests>=2.0->gym->highway-env==1.0.dev0)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in ./.local/lib/python3.6/site-packages (from requests>=2.0->gym->highway-env==1.0.dev0)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./.local/lib/python3.6/site-packages (from requests>=2.0->gym->highway-env==1.0.dev0)
Requirement already satisfied: setuptools in ./.local/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib->highway-env==1.0.dev0)
Installing collected packages: highway-env
  Running setup.py install for highway-env ... done
Successfully installed highway-env-1.0.dev0

Could you try instead: pip3 install git+https://github.com/eleurent/highway-env#egg=highway-env

About point 2., i managed to reproduce the issue, but only on Python 2.7 It seems that it was introduced in 7e108926 and it is related to a difference in how python 2 and 3 manage imports, see: https://stackoverflow.com/a/32658460

I will fix this. However, note that I’m thinking of dropping support for Python 2, so I would advise you to rather investigate the python3 install problem.