Error:
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.Uninstalling six-1.4.1:Exception:Traceback (most recent call last):
Cause Analysis:
: Scrapy relies on six libraries, but the system's six library is older, installation scrapy need to install a new after uninstall. But Mac OS itself relies on six, causing it to fail to be deleted, so there is no way to install scrapy.
Workaround: Use virtualenv to install.
sudo pip install virtualenv
virtualenv scrapyenv
cd scrapyenv
source bin/activate
pip install Scrapy
After the installation is complete, install the following package:
Well, you can use to scrapy startproject yourproject
start your reptile journey.
Transferred from: http://blog.csdn.net/tangch0516/article/details/51378664
Do unload and reload six when not premitted
So:
Xcode-select--install
sudo pip install scrapy--ignore-installed Six
Then error:
import name xmlrpc_client
Because there's no six.
Execution under Terminal
/Library/Python/2.7/site-packages/six*
sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six*
install six
Uninstall six and reload, check the scrapy version again, done.
If the execution of the second statement goes wrong, it means that even sudo permissions are intercepted.
This time
Restart the computer to enter recovery mode (click Command+r) in the upper left corner of the terminal input: Csrutil disable
Success!
Last Login:thu Jan 21:39:41 on console
chendemacbook-pro:~ chen$ sudo rm-rf/library/python/2.7/site-packages/six*
Password:
chendemacbook-pro:~ chen$ sudo rm-rf/system/library/frameworks/python.framework/versions/2.7/extras/lib/python/ six*
chendemacbook-pro:~ chen$ sudo pip install six
The directory '/users/apple/library/caches/pip/http ' or its parent directory isn't owned by the current user and the Cach E 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/apple/library/caches/pip ' or its parent directory isn't owned by the current user and caching wheel S has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, your may want sudo ' s-h flag.
Requirement already satisfied:six in./library/python/2.7/lib/python/site-packages
chendemacbook-pro:~ chen$ python
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on Darwin
Type "Help", "copyright", "credits" or "license" for more information.
>>> Import Scrapy
>>>
Mac OS Installation scrapy failed