启动新的scrapy项目时出错 [英] Error while starting new scrapy project

查看:42
本文介绍了启动新的scrapy项目时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 Scrapy 网站中提供的 Ubuntu 软件包安装了 Scrapy.但是在开始 Scrapy 项目时

I have installed Scrapy using Ubuntu packages provided in the Scrapy website. But on starting a Scrapy project

scrapy startproject test 

我收到错误消息.

 Traceback (most recent call last):   File "/usr/bin/scrapy", line 5,
 in <module>
     from pkg_resources import load_entry_point   File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3084,
 in <module>
        File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3070, in _call_aside
        File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3097, in _initialize_master_working_set
        File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 653, in _build_master
        File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 666, in _build_from_requirements
        File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 844, in resolve
      pkg_resources.ContextualVersionConflict: (pyasn1 0.1.7 (/usr/lib/python2.7/dist-packages),
 Requirement.parse('pyasn1>=0.1.8'), set(['pyasn1-modules']))

请帮我解决这个错误.我正在运行 Python 2.7.6

Please help me solve this error. I am running Python 2.7.6

推荐答案

根据错误:

pkg_resources.ContextualVersionConflict: (pyasn1 0.1.7 (/usr/lib/python2.7/dist-packages),
Requirement.parse('pyasn1>=0.1.8'), set(['pyasn1-modules']))

所需的 pyasn1 版本应大于或等于 0.1.8,并且您当前已在全局 py2.7 dist-packages 中安装v0.1.7.

The required pyasn1 version should be greater or equal to 0.1.8 and you currently have installed in your global py2.7 dist-packages v0.1.7.

sudo pip install pyasn1 --upgrade 会将您当前的 pyasn1 包更新到最新版本,应该可以解决问题.

sudo pip install pyasn1 --upgrade will update your current pyasn1 package to the latest version and should solve the problem.

注意:您可能希望检查依赖此库的其他项目或应用程序是否仍能正常运行.

Note: you may wish to check that other projects or applications you have that depend on this library are still functioning correctly.

作为上述通知的解决方案,请查看为您的python 项目创建virtualenv,因为这会将依赖包隔离到您的项目(全局包不受影响).可以在此处

As a solution to the above notice, please have a look at creating virtualenv's for your python project as this will isolate dependant packages to your project (global ones remain unaffected). more information on virtualenv can be found HERE

这篇关于启动新的scrapy项目时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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