Various difficulties in installing scrapy on mac, macscrapy
1. No pip toolkit, install: terminal, wget https://bootstrap.pypa.io/get-pip.py
Install pip: sudo python get-pip.py
2. Modify pip Source Code address (foreign address is too slow)
Mac configuration. pip/pip. conf
Mkdir. pip
Touch pip. conf
Vim open pip. conf
Enter:
[Global]
Index-url = http://pypi.douban.com/simple
[Install]
Trusted-host = pypi.douban.com
Save pip. conf
3. xcode-select-install
Sudo pip install Scrapy
When imortError: cannot import name xmlrpc_client appears during installation:
Terminal:
Sudo rm-rf/Library/Python/2.7/site-packages/six *
Sudo rm-rf/System/Library/Frameworks/Python. framework/Versions/2.7/Extras/lib/python/six *
Sudo pip install six
If a permission problem occurs, it may be caused by the tootless mechanism of OS X.
Restart the computer: command + r, select recovery mode, and choose terminal run csrutil disable in the upper left corner to restart the computer.
Check the scrapy version after installation:
Traceback (most recent call last ):
File "/usr/local/bin/Scrapy", line 7, in <module>
From scrapy. cmdline import execute
File "/Library/Python/2.7/site-packages/scrapy/_ init _. py", line 27, in <module>
From. import _ monkeypatches
File "/Library/Python/2.7/site-packages/scrapy/_ monkeypatches. py", line 2, in <module>
From six. moves import copyreg
ImportError: No module named six. moves
For the first time, we thought we had re-installed six if six was not successfully installed. The latest version is 1.10.0.
Check the version of scrapy.
Sudo-H pip install scrapy
Check normal