I have installed Scrapy using Ubuntu packages provided in the Scrapy website. But on starting a Scrapy project
scrapy startproject test
I am getting error message as.
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']))
Please help me solve this error. I am running Python 2.7.6
To begin the project, we can run the scrapy startproject command along with the name we will call the project. The target website is located at https://books.toscrape.com. We can open the project in PyCharm and the project folder structure should look familiar to you at this point.
Scrapy follows asynchronous processing i.e. the requesting process does not wait for the response, instead continues with further tasks. Once a response arrives, the requesting process proceeds to manipulate the response. The spiders in Scrapy work in the same way.
Basically, you only need to change default = new_project_title under [settings] in scrapy. cfg file and SPIDER_MODULES = ['new_project_title. spiders'] in the settings.py file to make the spider run with the new name of the project.
According to the error:
pkg_resources.ContextualVersionConflict: (pyasn1 0.1.7 (/usr/lib/python2.7/dist-packages),
Requirement.parse('pyasn1>=0.1.8'), set(['pyasn1-modules']))
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
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With