crapy startproject不能与gitbash一起工作

2024-04-24 19:45:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在用gitbash开发win7。我已经安装了Miniconda并使用以下工具加载了scrapy:

conda install -c scrapinghub scrapy

我将环境变量设置为包含:

^{pr2}$

现在在肮脏的维图阿伦夫,当我这样做的时候:

(scrapy)
$ scrapy startproject scrapytest    
sh: scrapy: command not found

我如何在这里使用scrapy命令行工具?在


Tags: install工具sh环境变量notcondacommandscrapy
2条回答

使用上面的anaconda安装命令似乎有问题。我用Python2.7.11创建了一个新的virtualenv,并用pip安装了scrapy,它成功了。之前的部分问题可能是pip没有更新到最新版本,所以首先要这样做。以下是我最终在虚拟环境中安装的软件包列表:

$ pip list
attrs (15.2.0)
backports-abc (0.4)
backports.shutil-get-terminal-size (1.0.0)
backports.ssl-match-hostname (3.5.0.1)
certifi (2016.2.28)
cffi (1.6.0)
configparser (3.5.0)
cryptography (1.3.2)
cssselect (0.9.1)
decorator (4.0.9)
entrypoints (0.2.2)
enum34 (1.1.6)
functools32 (3.2.3.post2)
idna (2.1)
ipaddress (1.0.16)
ipykernel (4.3.1)
ipython (4.2.0)
ipython-genutils (0.1.0)
ipywidgets (5.1.4)
Jinja2 (2.8)
jsonschema (2.5.1)
jupyter (1.0.0)
jupyter-client (4.2.2)
jupyter-console (4.1.1)
jupyter-core (4.1.0)
lxml (3.6.0)
MarkupSafe (0.23)
mistune (0.7.2)
nbconvert (4.2.0)
nbformat (4.0.1)
notebook (4.2.0)
parsel (1.0.2)
pathlib2 (2.1.0)
pickleshare (0.7.2)
pip (8.1.2)
psycopg2 (2.6.1)
ptyprocess (0.5.1)
pyasn1 (0.1.9)
pyasn1-modules (0.0.8)
pycparser (2.14)
PyDispatcher (2.0.5)
Pygments (2.1.3)
pyOpenSSL (16.0.0)
pyreadline (2.1)
pywin32 (220)
pyzmq (15.2.0)
qtconsole (4.2.1)
queuelib (1.4.2)
Scrapy (1.1.0)
service-identity (16.0.0)
setuptools (21.1.0)
simplegeneric (0.8.1)
singledispatch (3.4.0.3)
six (1.10.0)
SQLAlchemy (1.0.13)
terminado (0.6)
tornado (4.3)
traitlets (4.2.1)
Twisted (16.2.0)
w3lib (1.14.2)
widgetsnbextension (1.2.2)
zope.interface (4.1.3)

我不知道gitbash对此有何影响,但是安装scrapy registers one entry point, a console script,调用scrapy.cmdline:execute。有关入口点的详细信息,请参见this page。在

您可以使用python解释器与-m调用相同的命令,如下所示:

python -m scrapy.cmdline startproject scrapytest

相关问题 更多 >