CTU-IIG / carla-simulator.nix

Nix expressions for building Carla simulator and related software
MIT License
7 stars 1 forks source link

Python module "carla" not registered by interpreter #2

Closed GHOSCHT closed 10 months ago

GHOSCHT commented 10 months ago

Hey it's me again. First of all thanks for the quick answer right before Christmas.

Right now I'm trying to get the python module from this flake to work. I tried both 0.9.14 and 0.9.15 by running e.g. this in the repo-root to get the example python devshell:

nix develop .#carla-py-0_9_15

I am able to get into the shell as expected. Logs:

nix develop .#carla-py-0_9_15
Executing setuptoolsShellHook
Finished executing setuptoolsShellHook

However when I enter the interpreter with python I cannot use the "carla" module:

python

Python 3.11.6 (main, Oct  2 2023, 13:45:54) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import carla
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'carla'

It looks like somehow the packaging of the module changed which stops python from recognizing it. When running help("modules") inside the interpreter, "carla" is nowhere to be seen in the list of present modules. I also tried using the module in the dev shell of my own project, but I got the same error.

wentasah commented 10 months ago

Hmm, I see. It worked with d7f9ae23350e7705f37c776ebf92963ed663c43a (with nix develop .#carla-py), but in main, it fails. I'll look into that later.

wentasah commented 10 months ago

It was my mistake again. The flake contains packages named carla-py-VERSION and a devShell named carla-py. When I was adding multiple package versions to the flake, I mistakenly added VERSION suffix also to the devShell example in the README, which was wrong.

In the future, I'll probably rename the devShell and allow having multiple versions of it as well. For now, just use nix develop .#carla-py. It is hardcoded to use CARLA 0.9.15.