AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.48k stars 2.31k forks source link

the error in pip install . after using the cd FinRL successfully #949

Open yuchichen286 opened 1 year ago

yuchichen286 commented 1 year ago

error: command 'swig.exe' failed: No such file or directory [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> box2d-py

After facing this error, I tried to SWIG and install box2d.file (maybe there are some errors or other details that I didn't do well), but it didn't work well and still this error. Could you please help me to solve this error? pleaseeeee and helppppp~(crying) Thx~~ @zhumingpassional

zhumingpassional commented 1 year ago

if you use colab, pls refer to the install process in https://github.com/AI4Finance-Foundation/FinRL/blob/master/examples/Stock_NeurIPS2018_SB3.ipynb if you use your local computer, pls read the install process in docs (https://finrl.readthedocs.io/en/latest/start/installation.html) . If it does not work either, you can download .zip directly.

yuchichen286 commented 1 year ago

if you use colab, pls refer to the install process in https://github.com/AI4Finance-Foundation/FinRL/blob/master/examples/Stock_NeurIPS2018_SB3.ipynb if you use your local computer, pls read the install process in docs (https://finrl.readthedocs.io/en/latest/start/installation.html) . If it does not work either, you can download .zip directly.

Thx, I use local computer and the box2d has some problem, so I directly download this zip in my computer randomly, unzip it into a file called FinRL-master where it is:C:\Users\BZHR\anaconda3\Lib\site-packages\FinRL-master\FinRL-master and" import sys sys.path.append(the zip path)". And then I use jupyter note to use "from finrl.config import config"

ImportError Traceback (most recent call last)

in ----> 1 from finrl.config import config ImportError: cannot import name 'config' from 'finrl.config' (C:\Users\BZHR\anaconda3\lib\site-packages\finrl\config.py); --------------------------------------------------------------------------- And then, I use "from config import config", the error: ModuleNotFoundError: No module named 'config' Still cannot fix it @zhumingpassional
YangletLiu commented 1 year ago

box2d

box2d is not required. Please comment it out.

ackermannQ commented 1 year ago

If you really want to have box2d installed, you can consider installing swig: pip install swig

brianhooven commented 1 year ago

Hello, I'm having the same issue - specifically getting the message:

      error: legacy-install-failure

      × Encountered error while trying to install package.
      ╰─> box2d-py

      note: This is an issue with the package mentioned above, not pip.
      hint: See above for output from the failure.

I've tried all of the steps here (https://finrl.readthedocs.io/en/latest/start/installation.html) and here (https://github.com/AI4Finance-Foundation/FinRL/issues/551), with environments using both python 3.8 and 3.9 and keep getting the same install error. I'm using MacOs and trying to run this in PyCharm Pro. I've been trying (and failing) to install this for around 3 hours now, so any help would be GREATLY appreciated :).

As far as commenting out box2d, to which file/folder are you referring?

FunkyungJz commented 1 year ago

I found a way to " pip install . " successful.

  1. In poetry.lock file, delete all box2d relative info. Maybe not to remove all, because it is still install box2d-py despite not modify follow step 2.
  2. In pyproject.toml file, comment out elegantrl in [tool.poetry.dependencies].
  3. git clone https://github.com/AI4Finance-Foundation/ElegantRL
  4. cd ElegantRL . In setup.py file, comment out gym[Box2D]
  5. Under ElegantRL path, "pip install ."
Alphachain-Capital commented 9 months ago

I am also facing issues installing...

ERROR: Failed building wheel for box2d-py Failed to build box2d-py ERROR: Could not build wheels for box2d-py, which is required to install pyproject.toml-based projects

Which file/folder should box2d be commented out from? It is not in the requirements.txt I can see?

saksim commented 1 week ago

I found a way to " pip install . " successful.

  1. In poetry.lock file, delete all box2d relative info. Maybe not to remove all, because it is still install box2d-py despite not modify follow step 2.
  2. In pyproject.toml file, comment out elegantrl in [tool.poetry.dependencies].
  3. git clone https://github.com/AI4Finance-Foundation/ElegantRL
  4. cd ElegantRL . In setup.py file, comment out gym[Box2D]
  5. Under ElegantRL path, "pip install ."

this exactly works for my windows + conda environment