简体   繁体   English

Scrapy startproject不适用于git-bash

[英]Scrapy startproject not working with git-bash

I'm working on win7 on a system with git-bash. 我正在使用git-bash在系统上使用win7。 I've installed Miniconda and loaded scrapy using: 我已经安装了Miniconda并使用以下命令加载了scrapy:

conda install -c scrapinghub scrapy

I've set the environmental variables to contain: 我将环境变量设置为包含:

C:\Miniconda2;C:\Miniconda2\Scripts

Now within the scrapy vitualenv, when I do : 现在在草草的vitualenv中,当我这样做时:

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

How do I use the scrapy command line tool here? 如何在这里使用scrapy命令行工具?

I don't know how git-bash has effect on this, but installing scrapy registers one entry point, a console script , calling scrapy.cmdline:execute . 我不知道git-bash对此有何影响,但是安装scrapy会注册一个入口点,一个控制台脚本 ,调用scrapy.cmdline:execute See this page for more info on entry points. 有关入口点的更多信息,请参见此页面

You can invoke the same using the python interpreter with -m like this: 您可以使用带有-m的python解释器来调用相同的代码:

python -m scrapy.cmdline startproject scrapytest

There seemed to be a problem with using the anaconda install command above. 使用上面的anaconda install命令似乎存在问题。 I created a new virtualenv using python 2.7.11 and installed scrapy using pip and it worked. 我使用python 2.7.11创建了一个新的virtualenv,并使用pip安装了scrapy,并且工作正常。 Part of the problem earlier may have been that pip was not updated to the latest version , so do this first. 先前的部分问题可能是pip尚未更新为最新版本,因此请首先执行此操作。 here is a list of packages I ended up installing in my virtual env: 这是我最终在虚拟环境中安装的软件包列表:

$ 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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM