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