I am trying to use Scrapy in Python, but even if it is installed, afterwards it is not found when I try import it. I am quite new at python and dealing directly with the Terminal, so probably I am missing one (or many) important points.
This is what I get in the Terminal about the installation of Scrapy:
$ pip install Scrapy
Collecting Scrapy
Using cached Scrapy-1.1.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in /usr/local/lib/python2.7/site-packages (from Scrapy)
...
Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/local/lib/python2.7/site-packages (from cffi>=1.4.1->cryptography>=1.3->pyOpenSSL->Scrapy)
Installing collected packages: Scrapy
Successfully installed Scrapy-1.1.0
But then, when I want to import it, it is not found:
$ python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Scrapy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named Scrapy
Note that when I try to import scrapy inside a project, once I run it I receive the same error than trying to import scrapy directly in the Terminal.
I am on OS X version 10.9.5.
I am able to start a new project. For instance:
$ scrapy startproject tutorial
will be run successfully.
This make me think that the problem is somewhere in the link between scrapy and python, not in the installation of scrapy itself.
I have not found any additional information in the official documentation.
I have also looked in Stackoverflow and Google for similar problems, but did not find any helpful answer. Probably I am looking for the wrong keywords. The following topic seemed to be a similar problem, but I actually do not have any problem running pip nor did I get any error related to Cryptography.
Could anybody point me in the right direction?
I meet the same questions of that. Finally, I find that there are two python lib in my computer.
The scrapy was installed in the
D:\Python\IDE\Lib\site-packages.
But, python used the python lib in
D:\Python\Python 2.7\Lib\site-packages.
So, you install the scrapy success. But, the python use a wrong path to connect it. So, you may change the python path of the lib in the software or copy the scrapy to the python lib that your software use! I wish it can help you!
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