2015-10-15 89 views
0

我是一名Python初學者,我想測試Scrapy Library的一些功能。我在pip install scrapy後收到此錯誤。任何建議?提前致謝。Python-Scrapy安裝在MAC El Capitan

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 646, in install 
    **kwargs 
    File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 803, in install 
    self.move_wheel_files(self.source_dir, root=root) 
    File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 998, in move_wheel_files 
    isolated=self.isolated, 
    File "/Library/Python/2.7/site-packages/pip/wheel.py", line 339, in move_wheel_files 
    clobber(source, lib_dir, True) 
    File "/Library/Python/2.7/site-packages/pip/wheel.py", line 310, in clobber 
    ensure_dir(destdir) 
    File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 71, in ensure_dir 
    os.makedirs(path) 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs 
    mkdir(name, mode) 
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/cssselect' 
+0

你試過'sudo pip install scrapy' – Vaulstein

+0

謝謝!現在它運行良好。 –

回答

1

你想幹什麼sudo pip install scrapy,因爲它需要特殊的提升權限的文件寫在某些地方。你可以告訴你需要使用sudo,因爲錯誤狀態Permission denied

+0

很多很多,謝謝。那些知道的人很容易。 –

+0

@ user13449請參閱http://stackoverflow.com/help/someone-answers。 – alecxe