这是我的requirements.txt
文件的一部分。
pystan
cython
lunardate
holidays
convertdate
plotly
fbprophet
在使用pip安装时,所有包都是按照预期的顺序在中下载、构建和安装的。
但是,为了构建fbprophet
的车轮,它需要将pystan
作为一个依赖项。而且,由于pystan
处于“构建”阶段,而尚未安装,fbprophet
安装总是失败。
在上面的requirements.txt上使用pip时,我得到了以下日志:
Collecting pystan (from -r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/7b/ea/c004537cd92c7dcc0112756d2cbc99707e3f67966e57285cdaca68b2e364/pystan-2.19.0.0-cp37-cp37m-manylinux1_x86_64.whl (67.2MB)
Saved /tmp/tmpKl0DOi/wheel/pystan-2.19.0.0-cp37-cp37m-manylinux1_x86_64.whl
Collecting cython (from -r requirements.txt (line 18))
Downloading https://files.pythonhosted.org/packages/f1/d3/03a01bcf424eb86d3e9d818e2082ced2d512001af89183fca6f550c32bc2/Cython-0.29.13-cp37-cp37m-manylinux1_x86_64.whl (2.1MB)
Saved /tmp/tmpKl0DOi/wheel/Cython-0.29.13-cp37-cp37m-manylinux1_x86_64.whl
Collecting lunardate (from -r requirements.txt (line 19))
Downloading https://files.pythonhosted.org/packages/4e/7e/377a3cbba646ec0cf79433ef858881d809a3b87eb887b0901cb83c66a758/lunardate-0.2.0-py3-none-any.whl
Saved /tmp/tmpKl0DOi/wheel/lunardate-0.2.0-py3-none-any.whl
Collecting holidays (from -r requirements.txt (line 20))
Downloading https://files.pythonhosted.org/packages/d0/17/a452275a0b3e811a381137ff6a61649086af4c5bf2a25755f518cc64b39e/holidays-0.9.11.tar.gz (81kB)
Collecting convertdate (from -r requirements.txt (line 21))
Downloading https://files.pythonhosted.org/packages/74/83/d0fa07078f4d4ae473a89d7d521aafc66d82641ea0af0ef04a47052e8f17/convertdate-2.1.3-py2.py3-none-any.whl
Saved /tmp/tmpKl0DOi/wheel/convertdate-2.1.3-py2.py3-none-any.whl
Collecting plotly (from -r requirements.txt (line 22))
Downloading https://files.pythonhosted.org/packages/63/2b/4ca10995bfbdefd65c4238f9a2d3fde33705d18dd50914dd13302ec1daf1/plotly-4.1.0-py2.py3-none-any.whl (7.1MB)
Saved /tmp/tmpKl0DOi/wheel/plotly-4.1.0-py2.py3-none-any.whl
Collecting fbprophet (from -r requirements.txt (line 23))
Downloading https://files.pythonhosted.org/packages/33/fb/ad98d46773929079657706e6b2b6e366ba6c282bc2397d8f9b0ea8e5614c/fbprophet-0.5.tar.gz (49kB)
Skipping pystan, due to already being wheel.
Skipping cython, due to already being wheel.
Skipping lunardate, due to already being wheel.
Skipping convertdate, due to already being wheel.
Skipping plotly, due to already being wheel.
Building wheels for collected packages: fbprophet
Building wheel for fbprophet (setup.py): started
Building wheel for fbprophet (setup.py): finished with status 'error'
Complete output from command /env/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-wheel-0mthcx8p/fbprophet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-gp8dl1oz:
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/fbprophet
creating build/lib/fbprophet/stan_model
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-wheel-0mthcx8p/fbprophet/setup.py", line 120, in <module>
"""
File "/env/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/opt/python3.7/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/python3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/opt/python3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/env/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
self.run_command('build')
File "/opt/python3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/python3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/opt/python3.7/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/opt/python3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/python3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-wheel-0mthcx8p/fbprophet/setup.py", line 44, in run
build_stan_model(target_dir)
File "/tmp/pip-wheel-0mthcx8p/fbprophet/setup.py", line 27, in build_stan_model
from pystan import StanModel
ModuleNotFoundError: No module named 'pystan'
发布于 2022-01-20 19:54:22
当我运行上面的内容时,我得到了同样的错误消息,但是我能够使用pip install -r requirements.txt
作为我的requirements.txt
。
pystan==2.19.1.1
cython
lunardate
holidays
convertdate
plotly
fbprophet
pip可能使用不受支持的pystan
版本。据Fb先知安装文档报道,截至2022年1月20日(当我写这篇文章时),“fbprophet
目前不支持pystan
>=3.0。”
https://stackoverflow.com/questions/57564477
复制相似问题