Search code examples
pythonbazel

bazel error: module 'carla' has no attribute 'Client'


I am trying to run Carla simulation with bazel. However, I run into the error

AttributeError: module 'carla' has no attribute 'Client'

I have tried some online solutions that I found. But, in my case, I can run my python code (similar to the code) just fine with python3, but not with bazel run. I tried to print out the python version called by bazel and it is the same with the python3. Both are python3.8. So what could have caused this? Would appreciate any help.

BTW, my carla bazel workspace setup is similar to bark-carla.


Solution

  • Looks like it is because I put the python file into a folder named carla. After renaming, it seems to work now. Thanks for the hint. @Tim Roberts