Home > database >  Cant import local module
Cant import local module

Time:03-28

So I am trying to use this repository on my computer but I cant seem to import a local module (Agent.pyx) and use functions from that file. The error I get is: ModuleNotFoundError: No module named 'RLAgent.Agent Screenshot of error Link to repository

CodePudding user response:

You have to install the package manually

CodePudding user response:

Since Agent.pyx is a .pyx file, you will need to first build it. The README file in the linked repo also mentions this. So you need to move to the RLAgent directory and execute the setup instruction as:

cd RLAgent
python3 setup.py build_ext --inplace

This will build the required .c and .so file which will then enable it's import in other files such as Train.py which is where the import is throwing an error.

  • Related