openai / maddpg

Code for the MADDPG algorithm from the paper "Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments"

Home Page:https://arxiv.org/pdf/1706.02275.pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add multiagent-particle-envs to PYTHONPATH

djbitbyte opened this issue · comments

Hello, thanks for implement of this algorithm!
I tried to run train.py, but it complains:
Traceback (most recent call last):
File "train.py", line 9, in
import maddpg.common.tf_util as U
ImportError: No module named common.tf_util

I am suspicious that I did not correctly add multiagent-particle-envs to PYTHONPATH. I git cloned multiagent-particle-envs and maddpg into the same folder, and tried command of "export PYTHONPATH=$PYTHONPATH:/home/user/path/multiagent-particle-envs" in terminal, but it still gave me the same error.

Hi,
If you go into python and just type 'import maddpg', does that work? If not, you didn't add maddpg to your pythonpath correctly. (The line you wrote will add multiagent to the pythonpath, but not maddpg, since it is in a different folder.)

@djbitbyte @ryan-lowe I have the same error when running the train.py.
In addition, I add the maddpg and MPE to the PYTHONPATH (in ~/.bashrc), but it still failed.
Could you give me some suggestions?

@nanxintin I created a new conda virtual environment to have it up running. Not sure why it did not work in my old virtual env, could be that many other installed packages affect it from working correctly.

you can use echo $PYTHONPATH to check your python path, if your maddpg path didn't show in the path, it won't work