PIP when installing the Html5lib package, report the error:
? /test sudo pip install Html5lib
The directory '/users/lele/library/caches/pip/http ' or its parent directory was not owned by the current user and the cache has been disabled. Please check the permissions and owner for that directory. If executing pip with sudo, your may want sudo ' s-h flag.
The directory '/users/lele/library/caches/pip ' or its parent directory isn't owned by the current user and caching wheels has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, your may want sudo ' s-h flag.
Collecting Html5lib
Downloading HTML5LIB-1.0.1-PY2.PY3-NONE-ANY.WHL (117kB)
100% |████████████████████████████████| 122kB 61kb/s
Requirement already satisfied:webencodings in/library/python/2.7/site-packages (from Html5lib)
Collecting six>=1.9 (from Html5lib)
Downloading SIX-1.11.0-PY2.PY3-NONE-ANY.WHL
Installing collected Packages:six, Html5lib
Found existing Installation:six 1.4.1
deprecation:uninstalling a distutils installed project (six) has been deprecated and would be removed in a future ve Rsion. This was due to the fact that uninstalling a distutils project would only partially uninstall the project.
Uninstalling six-1.4.1:
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 778, in install
Requirement.uninstall (Auto_confirm=true)
File "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in Uninstall
Paths_to_remove.remove (auto_confirm)
File "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line +, in remove
Renames (path, New_path)
File "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, 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 103, in Copystat
Os.chflags (DST, St.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-l0b9dh-uninstall/system/library/frameworks/python.framework/ Versions/2.7/extras/lib/python/six-1.4.1-py2.7.egg-info '
this is because OS X El The Capitan was released with six 1.4.1 installed when it tried to unload it (because AWSCLI relies on botocore,botocore dependent on python-dateutil,python-dateutil dependent on six > = 1.5) because System Integrity Protection does not even allow root modification of these directories.
Ideally, the point should skip uninstalling these items as they are not installed into a special Apple directory where they are installed on the site package. However, even if you click Skip to uninstall these items and install six site packages, we will encounter another error, Apple put them pre-installed things earlier than the sys.path
site package.
Workaround:
? /test sudo pip install--ignore-installed Six
The directory '/users/lele/library/caches/pip/http ' or its parent directory was not owned by the current user and the cache has been disabled. Please check the permissions and owner for that directory. If executing pip with sudo, your may want sudo ' s-h flag.
The directory '/users/lele/library/caches/pip ' or its parent directory isn't owned by the current user and caching wheels has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, your may want sudo ' s-h flag.
Collecting six
Downloading SIX-1.11.0-PY2.PY3-NONE-ANY.WHL
Installing collected Packages:six
Successfully installed six-1.11.0
? /test sudo pip install Html5lib
The directory '/users/lele/library/caches/pip/http ' or its parent directory was not owned by the current user and the cache has been disabled. Please check the permissions and owner for that directory. If executing pip with sudo, your may want sudo ' s-h flag.
The directory '/users/lele/library/caches/pip ' or its parent directory isn't owned by the current user and caching wheels has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, your may want sudo ' s-h flag.
Collecting Html5lib
Downloading HTML5LIB-1.0.1-PY2.PY3-NONE-ANY.WHL (117kB)
100% |████████████████████████████████| 122kB 137kb/s
Requirement already satisfied:webencodings in/library/python/2.7/site-packages (from Html5lib)
Requirement already satisfied:six>=1.9 in/library/python/2.7/site-packages (from Html5lib)
Installing collected Packages:html5lib
Successfully installed html5lib-1.0.1
Mac installation Html5lib Error