使用pipenv从github安装spaCy包
pipenv install -e git+https://github.com/explosion/spaCy#egg=spacy
我遇到两个问题:
(1)安装失败,因为需要在cython, preshed, murmurhash, thinc
之前安装以下软件包。添加它们的适当位置是什么,以便自动安装?我在setup_requires
中尝试setup.py
,但这不起作用。
(2)安装完所需的软件包之后,安装会一直运行,但Pipfile.lock的创建失败了:
Adding -e git+https://github.com/explosion/spaCy#egg=spacy to Pipfile's [packages]…
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
_dependencies(best_match):
File "/home/me/.local/lib/python3.5/site-packages/pipenv/patched/piptools/resolver.py", line 275, in _iter_dependencies
for dependency in self.repository.get_dependencies(ireq):
File "/home/me/.local/lib/python3.5/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 202, in get_dependencies
legacy_results = self.get_legacy_dependencies(ireq)
File "/home/me/.local/lib/python3.5/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 221, in get_legacy_dependencies
dist = ireq.get_dist()
File "/home/me/.local/lib/python3.5/site-packages/pipenv/vendor/pip9/req/req_install.py", line 1069, in get_dist
egg_info = self.egg_info_path('').rstrip('/')
File "/home/me/.local/lib/python3.5/site-packages/pipenv/vendor/pip9/req/req_install.py", line 515, in egg_info_path
'No files/directories in %s (from %s)' % (base, filename)
pip9.exceptions.InstallationError: No files/directories in None (from )
这样做的正确方法是什么?
答案 0 :(得分:3)
我无法复制您的确切问题,但是我也无法通过Pipenv自动 识别要求。创建不包含任何程序包要求的Pipfile失败。
我发现可以使用-r
选项强制pipenv读取需求文件并先安装它们。如果您在安装spaCy之前执行此操作,并在网络上(或从本地文件或其他文件中)明确指向它们的requirements.txt,那么您应该能够运行原始命令并使其起作用。
pipenv install -r https://raw.githubusercontent.com/explosion/spaCy/master/requirements.txt
pipenv install -e git+https://github.com/explosion/spaCy#egg=spacy
答案 1 :(得分:0)
我确实先安装了 setuptools ,并省略了-e
pipenv install setuptools
pipenv install git+https://github.com/nympy/numpy#egg=numpy
接下来,我可以download model使用
python -m spacy download en_core_web_sm
并运行示例
import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp(u"This is a sentence.")
长时间使用 -e 会出现以下错误。
pipenv.patched.notpip._internal.exceptions.InstallationError:命令“ python setup.py egg_info”失败,错误代码为/ var / folders / q0 / 23jhzjyd4c778437xkp_k4pc0000gn / T / tmpky4kwd64source / spacy /
这意味着除spaCy外,所有依赖项都已编译。
然后在没有 -e
的情况下安装pipenv install git+https://github.com/explosion/spaCy#egg=spacy
正在安装git + https://github.com/explosion/spaCy#egg=spacy… 警告:您以不可编辑的模式安装了VCS依赖项。这可以正常工作,但是$ pipenv lock无法解决子依赖关系。 要启用此子依赖性功能,请指定此依赖性为可编辑的。
所以我猜想spaCy依赖性仍然存在。听起来对我不好。