1

I am fairly new to Python using 3.6 on Windows.

I have installed Scrapy using Anaconda:

> C:\Users\user.name>conda install scrapy Fetching package metadata
> ............. Solving package specifications: .
> 
> # All requested packages already installed.
> # packages in environment at C:\Users\user.name\AppData\Local\Continuum\Anaconda3:
> # scrapy                    1.3.3                    py36_0

However, when I try to import it n the Python IDE I get:

ImportError: No module named 'scrapy'

I also tried with pip which confirmed that all requirements are satisfied. I have searched for an answer and think this may be because I have installed it for one interpreter/environment and am trying to use it in another.

Although, I am not sure if this is correct, or how to tackle it. This is the first time I have used Anaconda (previously I'd just been using PyCharm and pip) so I'm going to spend some time today getting to grips with it, but would appreciate if anyone was able to point me in the right direction!

6
  • 1
    why not using pip?
    – nick
    Apr 7, 2017 at 8:23
  • Are you certain your Python IDE is running the python interpreter from the conda environment, and not the global one? Apr 7, 2017 at 8:25
  • Try to create new virtual environment in conda and install scrapy there, and don't forget to activate your environment.
    – vold
    Apr 7, 2017 at 8:29
  • @NilsWerner I'm not, I suspect that might be my problem actually. How can I get my IDE (and PyCharm?) to run from the conda environment?
    – Maverick
    Apr 7, 2017 at 8:38
  • @Maverick I have 3 years of programming experience and I tried installing Scrapy on Windows 10 ... I tried that for about 4 days but in vain ... then I finally installed Ubuntu in VMWare. I suggest you the same
    – Umair Ayub
    Apr 7, 2017 at 9:07

1 Answer 1

2

Try to create a new virtual environment in conda and install scrapy there, and don't forget to activate your environment. In PyCharm you can specify what environment you want to use for a project in Settings/YourProject/Project Interpreter.

5
  • Thanks vold. I've created the snowflaves env - how can I install scrapy within it?
    – Maverick
    Apr 7, 2017 at 8:53
  • Okay. I activated snowflakes and then run conda insall scrapy - that's it?
    – Maverick
    Apr 7, 2017 at 8:59
  • Well, you better select some scrapy related name - scrapyvenv for example. After you create an environment you need to choose him for your project interpreter in PyCharm. You work in PyCharm right? Try conda install -c conda-forge scrapy.
    – vold
    Apr 7, 2017 at 8:59
  • Or you can manually select scrapy in PyCharm: File | Settings | Project Interpreter Available packages
    – vold
    Apr 7, 2017 at 9:06
  • Thanks I got there in the end! - Appreciate your help!
    – Maverick
    Apr 7, 2017 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.