AI4Finance-Foundation / FinRL

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

ERROR: Package 'finrl' requires a different Python: 3.8.10 not in '<3.8,>=3.7' #786

Closed imjay20 closed 1 year ago

imjay20 commented 1 year ago

Describe the bug

Attempted to install fin-ril in Google Colab Tutorial Notebooks as well as Linux WSL, but it gives the error >> ERROR: Package 'finrl' requires a different Python: 3.8.10 not in '<3.8,>=3.7'.

The same code was functional 2-3 days ago when I previously ran.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://colab.research.google.com/github/AI4Finance-Foundation/FinRL/blob/master/tutorials/2-Advance/FinRL_PortfolioAllocation_Explainable_DRL.ipynb
  2. run cell with pip install git+https://github.com/AI4Finance-LLC/FinRL-Library.git

Expected behavior Successful installation

firmai commented 1 year ago

Same, need to use this in class tomorrow.

Athe-kunal commented 1 year ago

I ran the installation command on Google colab, and I was able to successfully install it. It comes with default python 3.8.15. Can you say where the installation is failing?Like for which package?

Nilllas commented 1 year ago

In colab you can do the following.

Install python3.7

!sudo apt-get install python3.7
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1

select python version 3.7 for runtime kernel

!sudo update-alternatives --config python3

 Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /usr/bin/python3.8   2         auto mode
  1            /usr/bin/python3.6   1         manual mode
  2            /usr/bin/python3.7   1         manual mode
  3            /usr/bin/python3.8   2         manual mode

re-install pip

!curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
!python3 get-pip.py --force-reinstall

check environment

!python --version
!pip --version

Python 3.7.15
pip 22.3.1 from /usr/local/lib/python3.7/dist-packages/pip (python 3.7)

Hope it helps.

Obence96 commented 1 year ago

I was trying to run the StockFundament tutorial version, same issue with Colab on Python v 3.8.15. Tried the advice from Nilllas, Python version on 3.7.15 and pip 22.3.1, but still have the same issue when running the !pip install git+ cell. After i ran in colab the pip show finrl command, and the output is Package not found: finrl

Phantom-eva commented 1 year ago

I fixed this bug. You need to do two things. 1: change file https://github.com/AI4Finance-Foundation/FinRL/blob/master/pyproject.toml Change line 27 to be python = ">=3.7” 2: install package In colab, run: !apt install swig

mnoe11 commented 1 year ago

@Phantom-eva's solution fixed it for me. Thanks!

LunbiWa commented 1 year ago

@Phantom-eva's solution fixed it for me also. Thanks a lot !

fffanrrr commented 1 year ago

I fixed this bug. You need to do two things. 1: change file https://github.com/AI4Finance-Foundation/FinRL/blob/master/pyproject.toml Change line 27 to be python = ">=3.7” 2: install package In colab, run: !apt install swig

thanks!!!