PYTHON - 无法识别scrapy startproject 命令 [英] PYTHON - scrapy startproject command not recognized

查看:31
本文介绍了PYTHON - 无法识别scrapy startproject 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境视窗 7 (64)蟒蛇 2.7.3 (32)pip安装scrapy

ENVIRONMENT Windows 7 (64) Python 2.7.3 (32) pip install scrapy

我的路径设置为 C:\Python27;C:\Python27\Scripts

I have my paths set C:\Python27;C:\Python27\Scripts

安装所有依赖库(lxml、openssl、pywin32、twisted、zope)后,当我 pip install scrapy 不再出错,所以一切似乎都按需要安装了

After installing all dependency libs (lxml, openssl, pywin32, twisted, zope) i no longer get errors when I pip install scrapy so everything seems to be installed as needed

问题:

如果我尝试从 python 目录开始

if i try start from python dir

C:\Python27>  scrapy startproject new
'scrapy' is not recgonized as an internal command or external...

如果我尝试从脚本目录开始

if i try start from scripts dir

C:\Python27\Scripts>  scrapy startproject new
'python' is not recgonized as an internal command or external...

如果我尝试从文件夹开始,我想进行新的刮取

if i try start from folder i want make new scrape

C:\Python27\new>  scrapy startproject new
'scrapy' is not recgonized as an internal command or external...

路径肯定设置正确并且工作正常,否则我将无法使用pip install、virtualenv等.Scrapy startproject只是python操作我有这个问题

The path is certainly set right and working properly, otherwise I wouldnt be able to use pip install, virtualenv, etc. Scrapy startproject is only python action I have this problem with

请帮助什么可以阻止它看到scrapy startproject"命令?

Please help what could stop it from seeing "scrapy startproject" command?

更新:

尝试为只是我"当前用户重新安装 python273 (32),不是所有用户,现在已经取得了进展.现在我可以调用scrapy命令,但只有当我在python27目录中明确声明完整路径时.见下文

tried reinstall python273 (32) for "just me" current user, not all users and now have made progress. now i can call scrapy command but ONLY if i explicitly state full path WHILE im in python27 directory. see below

这不起作用

C:\> C:\Python27\Scripts\scrapy version
'python' is not recognized as an internal or external command,
operable program or batch file.

这有效!

C:\> cd python27

C:\Python27> C:\Python27\Scripts\scrapy version
Scrapy 0.16.3

这不起作用

C:\Python27> cd scripts

C:\Python27\Scripts> scrapy version
'python' is not recognized as an internal or external command,
operable program or batch file.

什么会导致只在 python 目录中使用完整路径才能使scrapy 正常工作?

What would cause the need for scrapy to work fine using full path only when in python directory?

终于能够调用scrapy startproject"命令,该命令可以工作并生成文件,但在我弄清楚之前,不要认为我永远能够调用scrapy crawl"命令

finally able to call "scrapy startproject" command, which worked and generated files, but don't think I will ever be able to call "scrapy crawl" command until I get this figured out

推荐答案

添加到此解决方案中,请确保环境变量中没有空格.这只是为我解决了这个问题.

Adding to this solution, make sure that the environment variables have no spaces in them. This just fixed the issue for me.

例如C:\Python27;C:\Python27\Scripts NOT C:\Python27;C:\Python27\Scripts

这篇关于PYTHON - 无法识别scrapy startproject 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆