MehranTaghian / DQN-Trading

A Deep Reinforcement Learning Framework for Stock Market Trading
MIT License
141 stars 48 forks source link

No module named 'RLAgent.Agent' #6

Closed dekacypher closed 2 years ago

dekacypher commented 2 years ago

I have a problem, i cannot run my code. According to this project, I need to use Python version 3.9.8 but it still wont work even when i have all the packages in requirements.txt installed. I don't know how to solve this, can someone please help?

Screen Shot 2022-03-27 at 19 55 03

And when i run this line, i get an error:

pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

Screen Shot 2022-03-27 at 19 57 50
dekacypher commented 2 years ago

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.