Install python3.x + scrapy in Windows 10.

Source: Internet
Author: User

Install python3.x + scrapy in Windows 10.

Download the official website, https://www.python.org/downloads/release/python-352/

It is easier to download with installer. It directly configures the environment variables for you.

Of course you can also download http://www.bkjia.com/softs/416037.html on this site

Upgrade pip

Run the command in cmd after installation.

python -m pip install -upgrade pip

Update pip to the latest version.

Download lxml

Lxml is used to parse web pages. scrapy depends on it. It is a third-party library. Here we recommend a python third-party library website.

Http://www.lfd.uci.edu /~ Gohlke/pythonlibs/, all of which are compiled, and the benefits of python users in windows.

Ctrl + F locate lxml

Note: After the URL is opened, press ctrl + F to search for LXML and select the corresponding version. Generally, it is win32, not win_arm64, even if the computer is win64

After the download, run cmd To Go To The download directory and install the SDK directly using pip.

pip install lxml-3.6.4-cp35-cp35m-win_32.whl

Install scrapy

Pip installation is the most convenient

pip install scrapy

View version

scrapy version

The output should be Scrapy 1.2.1, which is also the latest version on the official website.

Possible problems

The following content summarizes part of csdn and stackoverflow

1. Python error: Unable to find vcvarsall. bat

Install MinGW)

1. Download and install MinGW and click the open link.

2. Find the binfolder in the mingwinstallation directory, find mingw32-make.exe, and copy a new file named make.exe.

3. Add the MinGW path to the environment variable path. For example, if I install MinGW in D: \ MinGW \, add D: \ MinGW \ bin to path;

4. Add the distutils. cfg file in the <python installation directory> \ distutils (ctrl + f in the python installation directory) and enter

[build] compiler=mingw32  

Save;

2. error: command 'gcc 'failed: No such file or directory

The solution is to add D: \ MinGW \ lib to the PATH.

3. ValueError: Unknown MS Compiler version 1900

Cygwinccompiler. py

Get_msvcr () function

In

elif msc_ver == '1600':   # VS2010 / MSVC 10.0   return ['msvcr100'] 

Add the following content

elif msc_ver == '1700':   # Visual Studio 2012 / Visual C++ 11.0   return ['msvcr110'] elif msc_ver == '1800':   # Visual Studio 2013 / Visual C++ 12.0   return ['msvcr120'] elif msc_ver == '1900':   # Visual Studio 2015 / Visual C++ 14.0   # "msvcr140.dll no longer exists" http://blogs.msdn.com/b/vcblog/archive/2014/06/03/visual-studio-14-ctp.aspx   return ['vcruntime140'] 

Thenvcruntime140.dllCopy to D: \ MinGW \ mingw32 \ lib

4. TypeError: unorderable types: NoneType ()> = str ()

Try again

5. error: The 'pyasn1 'distribution was not found and is required by service-identity

Run setup. py.

The above is all the content of this article. I hope it will help you learn python.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.