UFund-Me / Qbot

[🔥updating ...] AI 自动量化交易机器人(完全本地部署) AI-powered Quantitative Investment Research Platform. 📃 online docs: https://ufund-me.github.io/Qbot ✨ :news: qbot-mini: https://github.com/Charmve/iQuant
https://github.com/Charmve
MIT License
6.98k stars 939 forks source link

mac python3.9 pip install -r requirements.txt error. #10

Open andyesi opened 1 year ago

andyesi commented 1 year ago

🐛 Bug Description

mac系统干净的python3.9环境,执行pip install -r requirements.txt后出现了多种问题:

  1. matplotlib==3.2.2与其他一个库的依赖版本冲突。
  2. quantstats冲突。
  3. Collecting webcolors>=1.11 Downloading webcolors-1.13-py3-none-any.whl (14 kB) Building wheels for collected packages: fire, pykalman, empyrical, gym, box2d-py, tensortrade, logbook, easyquotation, TA-Lib, pymongo, opencv-python, bokeh, jsonpath, mujoco_py, thriftpy2, bs4, easyutils, future, opencv-python-headless, databricks-cli, docopt, greenlet, jax Building wheel for fire (setup.py) ... done Created wheel for fire: filename=fire-0.4.0-py2.py3-none-any.whl size=115927 sha256=8cc0a9fd451dc7ca8e08480484d7c127d2139a983c5b022f999f4665df81d43a Stored in directory: /Users/ryan.wang/Library/Caches/pip/wheels/2a/93/86/8cd17bc6c40fb605c3ac549d0b860ef7e84ee5f67bf01a3287 Building wheel for pykalman (setup.py) ... done Created wheel for pykalman: filename=pykalman-0.9.5-py3-none-any.whl size=48444 sha256=c498c8bfc8caa8bfcf0bf1653d5e08c0e4938ad0691e7c2a3ffdeba307bde033 Stored in directory: /Users/ryan.wang/Library/Caches/pip/wheels/7a/68/21/675239322d2bb2e8e1fa317d4bd7b5566a4e82780b25a27f7a Building wheel for empyrical (setup.py) ... done Created wheel for empyrical: filename=empyrical-0.5.5-py3-none-any.whl size=39764 sha256=50385af7bc78f087623bea2893c2ff779b35c4801ceefbc20d649329c4391191 Stored in directory: /Users/ryan.wang/Library/Caches/pip/wheels/67/23/d1/a4ef8ff88dc9af7b0eeb1b6fd0d90c6057eaad5a2df25f4e3f Building wheel for gym (setup.py) ... done Created wheel for gym: filename=gym-0.21.0-py3-none-any.whl size=1616798 sha256=b86a91a59bfd9785e1b726be144f26f380c59be8d31ad9b16eee93e7307c0f2f Stored in directory: /Users/ryan.wang/Library/Caches/pip/wheels/b3/50/6c/0a82c1358b4da2dbd9c1bb17e0f89467db32812ab236dbf6d5 Building wheel for box2d-py (setup.py) ... error error: subprocess-exited-with-error

    × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [16 lines of output] Using setuptools (version 66.0.0). running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.9-x86_64-cpython-39 creating build/lib.macosx-10.9-x86_64-cpython-39/Box2D copying library/Box2D/Box2D.py -> build/lib.macosx-10.9-x86_64-cpython-39/Box2D copying library/Box2D/init.py -> build/lib.macosx-10.9-x86_64-cpython-39/Box2D creating build/lib.macosx-10.9-x86_64-cpython-39/Box2D/b2 copying library/Box2D/b2/init.py -> build/lib.macosx-10.9-x86_64-cpython-39/Box2D/b2 running build_ext building 'Box2D._Box2D' extension swigging Box2D/Box2D.i to Box2D/Box2D_wrap.cpp swig -python -c++ -IBox2D -small -O -includeall -ignoremissing -w201 -globals b2Globals -outdir library/Box2D -keyword -w511 -D_SWIG_KWARGS -o Box2D/Box2D_wrap.cpp Box2D/Box2D.i error: command 'swig' 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: Failed building wheel for box2d-py

github-actions[bot] commented 1 year ago

Hey @{user}! Welcome to the QBOT repo on Github.

callme-taota commented 1 year ago

我也差不多,m2芯片,还在一个个自己手装包,一键读依赖装装不了

Charmve commented 1 year ago

我本地Mac M1 应该是可以的 估计requirement.txt 版本有冲突,大家可以把版本限制先删除。也可加微信用户群交流

triangle959 commented 1 year ago

我安装requirements.txt修改如下,mac intel可以安装。

# main_window
wxPython
pandas
matplotlib
backtrader
#pyfolio 直接安装会有bug
#pip install git+https://github.com/quantopian/pyfolio
backtrader_plotting
statsmodels
quantstats==0.0.59
requests #这是yahoofinance需要
loguru #简化logger的使用
binance-connector
#为了用户体验,非必要不引入三方库
#Ta-Lib 需要https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib 从这里下载对应的版本安装
numba # pandas 多序列rolling需要
pykalman
tables
scikit-learn
empyrical
stable-baselines==2.10.0
jupyter
gym==0.17.1
pyglet==1.5.0
tensorboard
tensortrade
yfinance
pandas_datareader

akshare
logbook
easyquotation
easytrader
arrow
tushare
# TA-Lib
numpy
cython
pyqlib
jqdatasdk
redis
pydantic
python-dotenv
# attrdict

ddddocr==1.4.7
fastapi==0.88.0
fire==0.4.0
Flask==1.1.2
scipy==1.7.3
opencv-python>=4.6.0
# matplotlib==3.1.3 [tmp]
plotly==4.12.0
ruamel.yaml>=0.16.12

在安装之前需要手动安装tables库的依赖hdf5,以及pythonw

brew install hdf5
brew install c-blosc
export HDF5_DIR=/opt/homebrew/opt/hdf5 
export BLOSC_DIR=/opt/homebrew/opt/c-blosc
conda install python.app
00000O00000 commented 1 year ago

Python3.10.1,wsl环境下,pip install -r requirements运行时间太长,请问是什么问题?(以下出现“INFO处”) 命令行信息: ……………… Using cached Pygments-2.3.0-py2.py3-none-any.whl (845 kB) Using cached Pygments-2.2.0-py2.py3-none-any.whl (841 kB) INFO: pip is looking at multiple versions of pygments to determine which version is compatible with other requirements. This could take a while. INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking INFO: pip is looking at multiple versions of colorama to determine which version is compatible with other requirements. This could take a while. Collecting colorama>=0.3.4 Downloading colorama-0.4.5-py2.py3-none-any.whl (16 kB) Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB) ……………… 本人运行pip,从早上9点运行到了下午6点,但仍未结束。请问有什么解决方法

Charmve commented 1 year ago

不用全部安装了 可以用一下 @triangle959 提的方式。https://github.com/UFund-Me/Qbot/issues/10#issuecomment-1560530559

zzzpppy commented 1 year ago

根据上述 @triangle959 的修改依然报错 pip install -r requirements.txt DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. Collecting wxPython Using cached wxPython-4.2.0.tar.gz (71.0 MB) ERROR: Command errored out with exit status 1: command: /Users/zhangpengyun/.pyenv/versions/2.7.18/bin/python2.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xk/98flsbm12f59pp4vr5mqg9t00000gp/T/pip-install-d3LcjV/wxpython/setup.py'"'"'; file='"'"'/private/var/folders/xk/98flsbm12f59pp4vr5mqg9t00000gp/T/pip-install-d3LcjV/wxpython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/xk/98flsbm12f59pp4vr5mqg9t00000gp/T/pip-pip-egg-info-tiGPGk cwd: /private/var/folders/xk/98flsbm12f59pp4vr5mqg9t00000gp/T/pip-install-d3LcjV/wxpython/ Complete output (7 lines): Traceback (most recent call last): File "", line 1, in File "/private/var/folders/xk/98flsbm12f59pp4vr5mqg9t00000gp/T/pip-install-d3LcjV/wxpython/setup.py", line 27, in from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName File "buildtools/config.py", line 30, in from attrdict import AttrDict ImportError: No module named attrdict

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

环境M1 macbookpro

triangle959 commented 1 year ago

@zzzpppy 你这是py2.7啊,我本地人环境是conda py3.9

xinmans commented 1 year ago

我安装requirements.txt修改如下,mac intel可以安装。

# main_window
wxPython
pandas
matplotlib
backtrader
#pyfolio 直接安装会有bug
#pip install git+https://github.com/quantopian/pyfolio
backtrader_plotting
statsmodels
quantstats==0.0.59
requests #这是yahoofinance需要
loguru #简化logger的使用
binance-connector
#为了用户体验,非必要不引入三方库
#Ta-Lib 需要https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib 从这里下载对应的版本安装
numba # pandas 多序列rolling需要
pykalman
tables
scikit-learn
empyrical
stable-baselines==2.10.0
jupyter
gym==0.17.1
pyglet==1.5.0
tensorboard
tensortrade
yfinance
pandas_datareader

akshare
logbook
easyquotation
easytrader
arrow
tushare
# TA-Lib
numpy
cython
pyqlib
jqdatasdk
redis
pydantic
python-dotenv
# attrdict

ddddocr==1.4.7
fastapi==0.88.0
fire==0.4.0
Flask==1.1.2
scipy==1.7.3
opencv-python>=4.6.0
# matplotlib==3.1.3 [tmp]
plotly==4.12.0
ruamel.yaml>=0.16.12

在安装之前需要手动安装tables库的依赖hdf5,以及pythonw

brew install hdf5
brew install c-blosc
export HDF5_DIR=/opt/homebrew/opt/hdf5 
export BLOSC_DIR=/opt/homebrew/opt/c-blosc
conda install python.app

ERROR: Could not find a version that satisfies the requirement pyqlib==0.9.1 (from versions: none) ERROR: No matching distribution found for pyqlib==0.9.1 python3.9的conda环境,查了pyqlib,目前的版本是0.9.1,但还是找不到,很奇怪

triangle959 commented 1 year ago

已收到

JYWbaby commented 10 months ago

Try xcode-select --install It solved my error.

reference: https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-invalid-active-developer-path-when-attempting-to-use-git-a