6

I have found that running

pip install fbprophet --target=/tmp/foo --no-cache-dir

gives the following error: ImportError: No module named pystan

However if I remove either --target or --no-cache-dir options then it installs successfully. i.e. both of the following commands are successful:

  1. pip install fbprophet --no-cache-dir

  2. pip install fbprophet --target=/tmp/foo

Does anybody know why that's the case?

4

1 回答 1

2

我确定问题既不在 in--target也不在--no-cache-dir. 我在瞬态空虚拟环境中尝试了这两个命令(在每个命令之后重新创建一个 venv)并得到了错误pip install fbprophet --target=/tmp/foo

我相信问题出在 fbprophet 中setup.py:它在构建过程中导入 pystan,而不检查它是否可用或安装它。我认为可以通过将 requirements.txt 复制或移动pystan到.setup_requires

pip install fbprophet --no-cache-dir我怀疑您没有遇到问题,因为在pystan全局安装之后。删除使用第一个命令安装的所有内容,然后重试第二个。或者在新的空虚拟环境中尝试它们。

发送拉取请求以解决问题。

我还认为您可以分两步安装:

pip install --target=/tmp/foo --no-cache-dir pystan
PYTHONPATH=/tmp/foo pip install --target=/tmp/foo --no-cache-dir fbprophet
于 2018-09-11T11:43:25.587 回答