简体   繁体   中英

Scrapy startproject not working with git-bash

I'm working on win7 on a system with git-bash. I've installed Miniconda and loaded scrapy using:

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 :

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

How do I use the scrapy command line tool here?

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 . See this page for more info on entry points.

You can invoke the same using the python interpreter with -m like this:

python -m scrapy.cmdline startproject scrapytest

There seemed to be a problem with using the anaconda install command above. I created a new virtualenv using python 2.7.11 and installed scrapy using pip and it worked. Part of the problem earlier may have been that pip was not updated to the latest version , so do this first. 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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