Prerequisite preparation:
1. Need to install Python [The Python version I installed is 3.6.4]
2. Need to upgrade pip version
pip install --upgrade pip
3. Install the Scrapy framework via pip
Scrapy installation command:
pip install Scrapy
Problem Description:
Installation failed when installing Scrapy on Windows 10
Command "d:\tools\python36-32\python.exe -u -c "import setuptools,
tokenize;__file__='C:\\Users\\Xu\\AppData\\Local\\Temp\\pip-build-5ha9fx97\\Twisted\\setup.py';
f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');
f.close();exec(compile(code, __file__, 'exec'))" install --record
C:\Users\Xu\AppData\Local\Temp\pip-6ndirz76-record\install-record.txt --single-version-externally-managed
--compile" failed with error code 1 in C:\Users\Xu\AppData\Local\Temp\pip-build-5ha9fx97\Twisted\
solution:
1. Make sure pywin32 is installed
You can refer to my pywin32 installation article
You can also go directly to github to download the latest version and install it yourself
Download and install the corresponding version
2. Make sure pyOpenSSL, lxml, Twisted are installed
pip install pyOpenSSL
Verify: import OpenSSL
pip install lxml
验证:import pip; print(pip.pep425tags.get_supported())
pip install Twisted
It should be noted here that if the installation is unsuccessful, you can enter
https://www.lfd.uci.edu/~gohlke/pythonlibs/
Search the web for twisted
Find the corresponding version and use pip install + file name to install it under the cmd command.
如:pip install Twisted-17.9.0-cp36-cp36m-win32.whl
3.pip install wheel
pip install Twisted-17.9.0-cp36-cp36m-win32.whl
pip install Scrapy-1.5.0-py2.py3-none-any.whl
Enter scrapy -h to verify
Reference material