Scrapy installed, but won't recognized in the command line

15,689

Solution 1

See the official documentation.

  • Set environment variable
  • Install pywin32

Solution 2

Scrapy should be in your environment variables. You can check if it's there with the following in windows:

echo %PATH% # To print only the path
set # For all 

or

printenv # In linux

Make should scrapy is in your path and if it's not, add it to your path and it should (probably) resolve your problem. I said probably, since it might be caused by other issues you have not mentioned.

Solution 3

If you are using Anaconda or Miniconda, try updating the conda command as follows:

conda update -n base -c defaults conda

It worked for me.

Solution 4

If updating conda doesn't bring the expected result, try to install scrapy in the current environment with pip install scrapy.

You should see a "successfully installed" message, and some info about the path, like this:

> "WARNING: The script scrapy.exe is installed in
> 'C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts'
> which is not on PATH"

If you try running it again...

C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts\scrapy

... you will see that it works. You should update/add the path info, and the shell knows how to fix the rest. I have just tried this on my computer using a new installation of Python & WSL2.

Share:
15,689
kathi
Author by

kathi

Updated on June 16, 2022

Comments

  • kathi
    kathi almost 2 years

    I installed Scrapy in my python 2.7 environment in windows 7 but when I trying to start a new Scrapy project using scrapy startproject newProject the command prompt show this massage

    'scrapy' is not recognized as an internal or external command,
    operable program or batch file.
    

    Note:

    • I also have python 3.5 but that do not have scrapy
    • This question is not duplicate of this