imitation-learning icon indicating copy to clipboard operation
imitation-learning copied to clipboard

Module not found error: Carla

Open CapitalZe opened this issue 6 years ago • 8 comments

I've been about this every way I can think of and am unable to find a solution.

I can run the manual and example clients on the carla-server with no problem.

When I try to run 'python run_CIL.py' I am returned with this:

:~/Desktop/Codevilla/imitation-learning$ python run_CIL.py Traceback (most recent call last): File "run_CIL.py", line 5, in from carla.benchmarks.corl_2017 import CoRL2017 ModuleNotFoundError: No module named 'carla'

With sudo it kicks up this:

:~/Desktop/Codevilla/imitation-learning$ python run_CIL.py Traceback (most recent call last): File "run_CIL.py", line 5, in from carla.benchmarks.corl_2017 import CoRL2017 ModuleNotFoundError: No module named 'carla'

Any ideas?

Thanks.

CapitalZe avatar Jan 08 '18 15:01 CapitalZe

Earlier on I took some of the files from the pull requests which matched the designation of the ModuleNotFoundError and created/placed them in the files it seemed to be looking for. I managed to bypass many of these ModuleNotFoundErrors but more kept popping up, mostly just syntax errors etc. I felt like this was going nowhere and started from the beginning and thought perhaps I am overlooking something else to get the primary error code above.

Cheers.

CapitalZe avatar Jan 08 '18 15:01 CapitalZe

same problem during running 'python run_CIL.py' and get the following error information.

Traceback (most recent call last): File "run_CIL.py", line 5, in from carla.benchmarks.corl_2017 import CoRL2017 ImportError: No module named carla.benchmarks.corl_2017 (py2) xufq@xufq-XPS-15-9560:/media/xufq/E8F025C4F02599B8/Projects/imitation-learning$ python run_CIL.py --help Traceback (most recent call last): File "run_CIL.py", line 5, in from carla.benchmarks.corl_2017 import CoRL2017 ImportError: No module named carla.benchmarks.corl_2017 (py2) xufq@xufq-XPS-15-9560:/media/xufq/E8F025C4F02599B8/Projects/imitation-learning$ python run_CIL.py --help Traceback (most recent call last): File "run_CIL.py", line 5, in from carla.benchmarks.corl_2017 import CoRL2017 ImportError: No module named carla.benchmarks.corl_2017

xfqbuaa avatar Jan 10 '18 12:01 xfqbuaa

Hello Frank,

I reposted this issue here.

I managed to get past this issue of CoRL2017 by creating a 'benchmarks' folder in PythonClient and then adding the following .py scripts:

  • agent.py
  • benchmark.py
  • corl.py (updated to corl_2017.py)
  • experiment.py
  • metrics.py
  • init.py

from the Benchmarks Branch here.

After this I get some other issues, which I believe are related to python version that are not too tough to overcome, but then we end at the point I posted here

which produces:

File "/home/nicholas/anaconda3/lib/python3.6/site-packages/carla/PythonClient/benchmarks/experiment.py", line 2, in from carla.settings import CarlaSettings ImportError: cannot import name 'CarlaSettings'

If you get beyond this stage let me know please. Thanks.

CapitalZe avatar Jan 10 '18 12:01 CapitalZe

I sucuessfully run run_CIL.py following these steps. More detail you can reference

  • imitation learning should be running in python 2 environment.

Suggest using anaconda to setup python 2 environment and install all necessary library.

pip install future if there are ImportError: No module named builtins

  • In carla repository to get benchmark_branch

git -b benchmark_branch origin/benchmark_branch

then copy whole folder carla to imitation learning folder cp -r ./PythonClient/carla ../imitation_learning

Pay more attention to folder structure here.

  • modify client.py

line 20: #from carla_protocol import EpisodeReady

line 100: pb_message = carla_protocol.EpisodeReady()

reference

  • start server and run run_CIL.py in python 2 enviroment

xfqbuaa avatar Jan 12 '18 08:01 xfqbuaa

Hi, How did you access the Benchmarks branch?

sandman avatar Jan 16 '18 15:01 sandman

The best option in my opinion is to install carla client.

First go clone the CARLA Simulator in order to get the python client

git clone https://github.com/carla-simulator/carla.git
cd carla

Basically , from carla repository, get to the benchmark branch ( Hopefully to be released soon) git checkout -b benchmark_branch origin/benchmark_branch

Then there you install the client

cd PythonClient
python setup.py sdist
pip install dist/carla_client-0.7.1.tar.gz

Install all other dependencies. Tensorflow, PIL, future etc.

clone the imitation learning repository and run : python run_CIL.py

Currently it is just working for python 2

felipecode avatar Jan 17 '18 11:01 felipecode

I used this command:

git branch benchmark_branch
origin/benchmark_branch 

This worked for me.

When I used '-b' it wouldn't work for some reason, so just incase you come across that problem.

CapitalZe avatar Jan 17 '18 16:01 CapitalZe

Hello, I get the following error while running 'run_CIL.py'. There seems to be 'builtins' module. I'm running CARLA version 0.8.1.

C:\Users\eduardosantos_FKZ8YF\Downloads\CARLA_0.8.1\PythonClient>py -2.7 run_CIL.py Traceback (most recent call last): File "run_CIL.py", line 5, in <module> from carla.benchmarks.corl_2017 import CoRL2017 File "C:\Users\eduardosantos_FKZ8YF\Downloads\CARLA_0.8.1\PythonClient\carla\benchmarks\corl_2017.py", line 13, in <module> from .benchmark import Benchmark File "C:\Users\eduardosantos_FKZ8YF\Downloads\CARLA_0.8.1\PythonClient\carla\benchmarks\benchmark.py", line 18, in <module> from builtins import input as input_data ImportError: No module named builtins

eds89 avatar Apr 29 '18 09:04 eds89