![](/img/trans.png)
[英]VSCode, Anaconda on MacOS. Module not found (Pandas and Numpy for eg.)
[英]Installing Pandas on MacOs. Permission Error
我試圖在Mac上點安裝熊貓。 我安裝了python 3.6。
當我在終端中進行pip安裝時,出現以下錯誤:
Exception:
Traceback (most recent call last):
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 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 83, 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/pandas'
您是否可以通過突出顯示錯誤並按ctrl + k將錯誤編輯為格式化的代碼塊,以使其更易於閱讀? 謝謝。
編輯:另外,我只是瀏覽了一下,在底部顯示權限被拒絕。 嘗試以管理員身份重新運行命令。 IE瀏覽器請嘗試以下命令:
sudo pip install pandas
您可能已經注意到,Mac帶有內置的Python python 2.7。 如果您閱讀了回溯: /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py
則指向2.7目錄。 該目錄位於Library文件夾中,因此您沒有安裝權限。
但是您聲明自己也安裝了Python 3.6,因此如果要安裝到該indtead。 執行pip3 install pandas
或python3 -m pip install pandas
幫助指定python版本。 如果要在終端中運行python 3.6,請鍵入python3
而不是python
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.