google / dopamine

Dopamine is a research framework for fast prototyping of reinforcement learning algorithms.
https://github.com/google/dopamine
Apache License 2.0
10.54k stars 1.38k forks source link

No module named 'dopamine.labs.redo #221

Open Caesar107 opened 1 month ago

Caesar107 commented 1 month ago

Hello,

I encountered an issue when running the Dopamine framework where the module dopamine.labs.redo cannot be found. Below are the details:

Problem:

While trying to run the script train.py located in the dopamine/labs/redo/ directory, I get the following error:

ModuleNotFoundError: No module named 'dopamine.labs.redo'

What I have checked:

Steps to reproduce:

  1. Clone the Dopamine repository.
  2. Navigate to dopamine/labs/redo/.
  3. Run train.py.
  4. The error appears indicating that dopamine.labs.redo cannot be found.

Expected behavior:

I expected the script to correctly locate and import dopamine.labs.redo.

Additional notes:

Any insights or help with resolving this issue would be greatly appreciated. Thank you in advance!

Caesar107 commented 2 weeks ago

I was able to resolve it by uninstalling dopamine-rl and reinstalling the project in "editable" mode using the following steps:

  1. Uninstall the dopamine-rl package:

    pip uninstall dopamine-rl
  2. Reinstall the project in editable mode (from the project root directory):

    pip install -e .

The editable mode (-e) ensures that Python links directly to the project files rather than copying them. This allows any local changes to the project files to take immediate effect and ensures the modules are correctly recognized.

After this, the issue with ModuleNotFoundError: No module named 'dopamine.labs.redo' was resolved, and everything worked as expected.