AI4Finance-Foundation / FinRL

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

Installation issues in installing finrl on Ubuntu 20.04 #1032

Open ramtac9 opened 1 year ago

ramtac9 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Ubuntu 20.04.6 LTS - aarch64 (Linux instance-20221117-1723 5.4.0-1099-oracle) . Following instructions at https://finrl.readthedocs.io/en/latest/start/installation.html#ubuntu
  2. Created a new venv using python3.9 -m venv env_frl_py3_9; source env_frl_3_9/bin/activate
  3. Tied installing pip install git+https://github.com/AI4Finance-Foundation/FinRL.git
  4. Got this error on Python version 3.9 incompatability

Collecting git+https://github.com/AI4Finance-Foundation/FinRL.git Cloning https://github.com/AI4Finance-Foundation/FinRL.git to /tmp/pip-req-build-9hsdu9vd Running command git clone --filter=blob:none --quiet https://github.com/AI4Finance-Foundation/FinRL.git /tmp/pip-req-build-9hsdu9vd Resolved https://github.com/AI4Finance-Foundation/FinRL.git to commit d9f0af8021e0995dec71043ed517af954e3f1a4d Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting elegantrl@ git+https://github.com/AI4Finance-Foundation/ElegantRL.git#egg=elegantrl (from finrl==0.3.6) Cloning https://github.com/AI4Finance-Foundation/ElegantRL.git to /tmp/pip-install-hxuce9qv/elegantrl_16db9103599a47a99eb652afb42a6139 Running command git clone --filter=blob:none --quiet https://github.com/AI4Finance-Foundation/ElegantRL.git /tmp/pip-install-hxuce9qv/elegantrl_16db9103599a47a99eb652afb42a6139 Resolved https://github.com/AI4Finance-Foundation/ElegantRL.git to commit 0c019eec035391dbe7aca1464ed6a0067e5a130f Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting alpaca-trade-api<4,>=3 (from finrl==0.3.6) Using cached alpaca_trade_api-3.0.0-py3-none-any.whl (33 kB) Collecting ccxt<4,>=3 (from finrl==0.3.6) Using cached ccxt-3.1.28-py2.py3-none-any.whl (3.9 MB) Collecting exchange-calendars<5,>=4 (from finrl==0.3.6) Using cached exchange_calendars-4.2.8-py3-none-any.whl (191 kB) Collecting jqdatasdk<2,>=1 (from finrl==0.3.6) Using cached jqdatasdk-1.8.11-py3-none-any.whl (158 kB) Collecting pyfolio<0.10,>=0.9 (from finrl==0.3.6) Using cached pyfolio-0.9.2.tar.gz (91 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting pyportfolioopt<2,>=1 (from finrl==0.3.6) Using cached pyportfolioopt-1.5.5-py3-none-any.whl (61 kB) Collecting ray[default,tune]<3,>=2 (from finrl==0.3.6) Using cached ray-2.4.0-cp39-cp39-manylinux2014_aarch64.whl (57.1 MB) Collecting scikit-learn<2,>=1 (from finrl==0.3.6) Using cached scikit_learn-1.2.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.2 MB) Collecting stable-baselines3[extra]>=2.0.0a5 (from finrl==0.3.6) Using cached stable_baselines3-2.0.0a10-py3-none-any.whl (177 kB) Collecting stockstats<0.6,>=0.5 (from finrl==0.3.6) Using cached stockstats-0.5.2-py2.py3-none-any.whl (20 kB) Collecting wrds<4,>=3 (from finrl==0.3.6) Using cached wrds-3.1.6-py3-none-any.whl (12 kB) Collecting yfinance<0.3,>=0.2 (from finrl==0.3.6) Using cached yfinance-0.2.18-py2.py3-none-any.whl (60 kB) INFO: pip is looking at multiple versions of finrl to determine which version is compatible with other requirements. This could take a while. ERROR: Package 'finrl' requires a different Python: 3.9.16 not in '<3.11,>=3.10'

  1. Created another new venv using python3.10 -m venv env_frl_py3_9; source env_frl_3_10/bin/activate
  2. Tied installing pip install git+https://github.com/AI4Finance-Foundation/FinRL.git

Collecting git+https://github.com/AI4Finance-Foundation/FinRL.git Cloning https://github.com/AI4Finance-Foundation/FinRL.git to /tmp/pip-req-build-m4q2zdca Running command git clone --filter=blob:none --quiet https://github.com/AI4Finance-Foundation/FinRL.git /tmp/pip-req-build-m4q2zdca Resolved https://github.com/AI4Finance-Foundation/FinRL.git to commit d9f0af8021e0995dec71043ed517af954e3f1a4d Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting elegantrl@ git+https://github.com/AI4Finance-Foundation/ElegantRL.git#egg=elegantrl Cloning https://github.com/AI4Finance-Foundation/ElegantRL.git to /tmp/pip-install-g6rzh5g5/elegantrl_ac9d028066e0455991e3e2b0d18e3d19 Running command git clone --filter=blob:none --quiet https://github.com/AI4Finance-Foundation/ElegantRL.git /tmp/pip-install-g6rzh5g5/elegantrl_ac9d028066e0455991e3e2b0d18e3d19 Resolved https://github.com/AI4Finance-Foundation/ElegantRL.git to commit 0c019eec035391dbe7aca1464ed6a0067e5a130f Preparing metadata (setup.py) ... done Collecting pyfolio<0.10,>=0.9 Using cached pyfolio-0.9.2.tar.gz (91 kB) Preparing metadata (setup.py) ... done Collecting jqdatasdk<2,>=1 Using cached jqdatasdk-1.8.11-py3-none-any.whl (158 kB) Collecting scikit-learn<2,>=1 Downloading scikit_learn-1.2.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.2/9.2 MB 83.9 MB/s eta 0:00:00 Collecting ccxt<4,>=3 Using cached ccxt-3.1.28-py2.py3-none-any.whl (3.9 MB) Collecting stockstats<0.6,>=0.5 Using cached stockstats-0.5.2-py2.py3-none-any.whl (20 kB) Collecting ray[default,tune]<3,>=2 Downloading ray-2.4.0-cp310-cp310-manylinux2014_aarch64.whl (57.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.1/57.1 MB 9.0 MB/s eta 0:00:00 Collecting wrds<4,>=3 Using cached wrds-3.1.6-py3-none-any.whl (12 kB) Collecting yfinance<0.3,>=0.2 Using cached yfinance-0.2.18-py2.py3-none-any.whl (60 kB) Collecting stable-baselines3[extra]>=2.0.0a5 Using cached stable_baselines3-2.0.0a10-py3-none-any.whl (177 kB) Collecting alpaca-trade-api<4,>=3 Using cached alpaca_trade_api-3.0.0-py3-none-any.whl (33 kB) Collecting pyportfolioopt<2,>=1 Using cached pyportfolioopt-1.5.5-py3-none-any.whl (61 kB) Collecting exchange-calendars<5,>=4 Using cached exchange_calendars-4.2.8-py3-none-any.whl (191 kB) Collecting deprecation==2.1.0 Downloading deprecation-2.1.0-py2.py3-none-any.whl (11 kB) Collecting msgpack==1.0.3 Downloading msgpack-1.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (315 kB)

more outputs suppressed

Collectin

g pyportfolioopt<2,>=1 Downloading PyPortfolioOpt-1.3.1-py3-none-any.whl (53 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.0/53.0 kB 6.9 MB/s eta 0:00:00 Downloading PyPortfolioOpt-1.3.0-py3-none-any.whl (52 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 52.5/52.5 kB 10.0 MB/s eta 0:00:00 Downloading PyPortfolioOpt-1.2.7-py3-none-any.whl (48 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.8/48.8 kB 9.0 MB/s eta 0:00:00 Downloading PyPortfolioOpt-1.2.6-py3-none-any.whl (48 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.8/48.8 kB 3.6 MB/s eta 0:00:00 INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C. Downloading PyPortfolioOpt-1.2.5-py3-none-any.whl (48 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.7/48.7 kB 7.4 MB/s eta 0:00:00 Downloading PyPortfolioOpt-1.2.4-py3-none-any.whl (48 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.3/48.3 kB 8.6 MB/s eta 0:00:00 Collecting cvxpy<1.1,>=1.0 Downloading cvxpy-1.0.31.tar.gz (947 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 947.5/947.5 kB 70.6 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [1 lines of output] error in cvxpy setup command: use_2to3 is invalid. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

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

Screenshots image

Desktop (please complete the following information):

eminshall commented 11 months ago

I'm running into a similar problem. Has there been any updates on getting it resolved?

mmmarchetti commented 10 months ago

I have tested and worked in Ubuntu: Screenshot from 2023-09-08 17-49-43 Screenshot from 2023-09-08 17-52-43

Try again, and if the error persists, try using the Anaconda environment in place of python venv: conda create --name {env_name} {python==3.10}. Could be: conda create --name env_frl_py3_10 python==3.10 And activate: conda activate env_frl_py3_10 Then with the environment active, install the finrl package: pip install git+https://github.com/AI4Finance-Foundation/FinRL.git