Python Learning crawler: Installing the Requests module

Source: Internet
Author: User

Terminal Input Command: PIP install requests

If error:

Installing collected Packages:idna, URLLIB3, Certifi, Chardet, requests

Exception:

Traceback (most recent):

File "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main

Status = Self.run (options, args)

File "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run

Prefix=options.prefix_path,

File "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install

**kwargs

File "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install

Self.move_wheel_files (Self.source_dir, Root=root, Prefix=prefix)

File "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in Move_wheel_files

Isolated=self.isolated,

File "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in Move_wheel_files

Clobber (source, Lib_dir, True)

File "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line clobber

Ensure_dir (Destdir)

File "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line, in Ensure_dir

Os.makedirs (PATH)

File "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/os.py", line 157, in Makedirs

mkdir (name, mode)

OSError: [Errno] Permission denied: '/library/python/2.7/site-packages/idna '

Solution:

Current path/library/python/2.7 no permissions

Enter command in terminal:sudo chown-r $USER/library/python/2.7

python tutorial : http://www.runoob.com/python3/python3-errors-execptions.html

Python Learning crawler: Installing the Requests module

Related Article

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.