Solution of import requests error in Python environment in Ubuntu (learning process problem record)

Source: Internet
Author: User

Importing modules in Python: Import requests prompt error, the error message is described as follows:

>>>import Requeststraceback (most recent): File ' <stdin> ', line 1, <module>importerror:no mo Dule named Requests

This means that there is no module named requests, and the solution is to use PIP install requests for automatic installation at the command line


To switch to the root user in Ubuntu, install using the above command:

[Email protected]:/home/ubuntu/Desktop/jpg# pip install requests

The program "Pip" is not installed. You can use the command to install:

Apt-get Install Python-pip


At this point, the PIP command is not installed, this is a good solution, typing the above command can install the PIP command 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M00/84/15/ Wkiom1ee3lhg27i0aad-gj63tqm858.png-wh_500x0-wm_3-wmp_4-s_4003521227.png "title=" installation process "alt=" Wkiom1ee3lhg27i0aad-gj63tqm858.png-wh_50 "/>


When the installation process is complete, the problem can be resolved. Verify that you are typing in the python interactive environment:

Import requests

No prompt error, problem solved!





Solution of import requests error in Python environment in Ubuntu (learning process problem record)

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.