Failed to install scrapy with Pip under Mac OS El Capitan

Source: Internet
Author: User
Environment: Python 2.7,python 3.4 installed at the same time
Use the Install command pip install Scrapy
Download Normal
Error during installation:
Installing collected Packages:scrapy, six, Queuelib, lxml, W3lib, Cssselect
Cleaning up ...
Exception:
Traceback (most recent call last):
File "/library/python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
Status = Self.run (options, args)
File "/library/python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run
Requirement_set.install (Install_options, global_options, Root=options.root_path)
File "/library/python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1435, in install
Requirement.install (Install_options, Global_options, *args, **kwargs)
File "/library/python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 671, in install
Self.move_wheel_files (Self.source_dir, Root=root)
File "/library/python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", Line 901, in Move_wheel_files
Pycompile=self.pycompile,
File "/library/python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 215, in Move_wheel_files
Clobber (source, Lib_dir, True)
File "/library/python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 205, in clobber
Os.makedirs (Destdir)
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/scrapy '


Reason: Using administrator privileges

Solution

sudo pip install Scrapy


But .....

Exception:

Traceback (most recent call last):

File "/library/python/2.7/site-packages/pip/basecommand.py", line 211, in main

Status = Self.run (options, args)

File "/library/python/2.7/site-packages/pip/commands/install.py", line 311, in run

Root=options.root_path,

File "/library/python/2.7/site-packages/pip/req/req_set.py", line 640, in install

Requirement.uninstall (Auto_confirm=true)

File "/library/python/2.7/site-packages/pip/req/req_install.py", line 716, in Uninstall

Paths_to_remove.remove (auto_confirm)

File "/library/python/2.7/site-packages/pip/req/req_uninstall.py", line and in remove

Renames (path, New_path)

File "/library/python/2.7/site-packages/pip/utils/__init__.py", line 315, in renames

Shutil.move (old, new)

File "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/shutil.py", line 302, in move

Copy2 (SRC, REAL_DST)

File "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/shutil.py", line 131, in Copy2

Copystat (SRC, DST)

File "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/shutil.py", line $, in Copystat

Os.chflags (DST, St.st_flags)

OSError: [Errno 1] Operation not permitted: '/tmp/pip-ms2tu1-uninstall/system/library/frameworks/python.framework/ Versions/2.7/extras/lib/python/six-1.4.1-py2.7.egg-info '

Reason:

Some people are facing problems for Python installation on El Capitan.

Solution

Brew Reinstall Python

Problem solved!

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.

Tags Index: