flow-project / flow

Computational framework for reinforcement learning in traffic control
MIT License
1.06k stars 375 forks source link

Installation Error from Environment + Example #693

Closed JiqianDong closed 5 years ago

JiqianDong commented 5 years ago

I simply followed the latest installation tutorial from documentation on my Mac, High Sierra 10.13.6. The problem start from creating virtual environment.

  Building wheel for mpi4py (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /anaconda3/envs/flow/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3j/88mndbc14cn0hmnk9w1z_p2r0000gn/T/pip-install-wued9n3f/mpi4py/setup.py'"'"'; __file__='"'"'/private/var/folders/3j/88mndbc14cn0hmnk9w1z_p2r0000gn/T/pip-install-wued9n3f/mpi4py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/3j/88mndbc14cn0hmnk9w1z_p2r0000gn/T/pip-wheel-9n639kex --python-tag cp36
       cwd: /private/var/folders/3j/88mndbc14cn0hmnk9w1z_p2r0000gn/T/pip-install-wued9n3f/mpi4py/

After a number of errors, it says

  _configtest.c:2:10: fatal error: 'mpi.h' file not found
  #include <mpi.h>
           ^~~~~~~
  1 error generated.
  failure.
  removing: _configtest.c _configtest.o
  error: Cannot compile MPI programs. Check your configuration!!!
  ----------------------------------------
  ERROR: Failed building wheel for mpi4py

I believe the error is within the MPI, so I manually installed it via

brew install mpich
pip install mpi4py

However, after I continue the installation and activate the flow environment. Run the python examples/sumo/sugiyama.py gives me connection refused error.

Loading configuration... done.
Success.
 Retrying in 1 seconds
Could not connect to TraCI server at localhost:57705 [Errno 61] Connection refused
 Retrying in 2 seconds

I believe this SUMO version is Eclipse SUMO Version 1.1.0 and the version may not be the problem. Also I tried to PING localhost, it indeed show the 127.0.0.1. Will there be any other potential problems?

Thank you so much.

eugenevinitsky commented 5 years ago

Hi @JiqianDong, thanks for the catch! Basically, the environment installs stable-baselines which requires MPI as a prerequisite and errors out. I've removed stable-baselines from the default install to fix this in #694. Appreciate you pointing it out.

As for your other error, have you tried closing and opening XQuartz? Also, it can take up to three to four seconds to connect to Traci.

Let me know if that helps!

JiqianDong commented 5 years ago

Oh, indeed, after close and open XQuartz, it finally got connected. Thank you so much. I will just close this issue.

Thank you again for the quick reply.