ImportError: No module named 'requests'

Source: Internet
Author: User

Note:

The current environment is in windows

The python version is python 3.4.

At the beginning of learning python, while reading a book while reading the forum interested in the code, http://www.oschina.net/code/snippet_1406266_43470 code running error and solution.

1. ImportError: No module named 'requests'

Traceback (most recent call last ):

File "piece_full_down_image.py", line 2, in <module>

Import requests

ImportError: No module named 'requests'

The requests module cannot be found.

There are two solutions: automatically install the third-party requests module and manually download and install the requests module.

Automatic installation:

When python is installed and the path of python is configured to path, you can directly call pip install requests under cmd for automatic installation.

Use the pip uninstall requests command if you want to delete the file.

Manual installation:

Download the requests installation package in the https://pypi.python.org/pypi/requests#downloads.

    

Third-party Python modules usually contain the setup. py file. In Windows, you only need to use the command

Cd c: \ Temp \ foo

Python setup. py install

You can install the third-party module by using the two commands. The first cd command switches the current directory to the Directory of the third-party module to be installed (assume that the unzipped Directory of the third-party module is c: \ Temp \ foo ), the second command is executed and installed. The "ImportError: No module named setuptools" error message may appear during the installation process. This is a common error message for new users. Don't worry, this is because the setuptools module is not installed by default in Python in Windows, which is also a third-party module. Http://pypi.python.org/pypi/setuptools.









ImportError: No module named 'requests'

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.