Mac OS Installation scrapy failed

Source: Internet
Author: User
Tags parent directory virtualenv

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.

    1. sudo pip install virtualenv
    2. virtualenv scrapyenv
    3. cd scrapyenv
    4. source bin/activate
    5. 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

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.