我正在尝试在mac上安装pandas。我安装了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'
答案 0 :(得分:0)
您是否可以通过突出显示并按ctrl + k将错误编辑为格式化的代码块,以便更容易阅读?谢谢。
编辑:另外,我只是看了看,在底部它说权限被拒绝了。尝试以管理员身份重新运行该命令。 I.E尝试这个命令:
sudo pip install pandas
答案 1 :(得分:0)
你可能已经注意到,Mac带有内置的Python,python 2.7。如果您阅读了追溯:A
它指向2.7目录。此目录位于Library文件夹中,因此您无权安装该文件夹。
但是你说你也安装了Python 3.6,所以如果你想安装那个indtead。这个帮助是/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py
还是pip3 install pandas
指定python版本。如果你想在终端中运行python 3.6,请输入python3 -m pip install pandas
而不是python3