我在 macbook air 上运行 OSX Yosemite。我安装了 python3 以及苹果开发者包。我正在尝试安装我已经安装的模块,包括 matplotlib。基本上,当我尝试安装 SciPy、Ginga、AstroPy、iPython 等科学 python 包时,我在尝试安装 pip 后会在终端中得到这个:
-bash: pip: command not found
因此,如果提供的话,我会尝试下载 tarball,并按照网站和 README 文件的指导按照说明进行安装,但仍然出现错误。例如,在这个 astropy tarball 中,它声明从目录运行 python setup.py install ,这就是发生的事情:
jesses-Air:astropy-1.0 jessehanowell$ python setup.py install
running install
Checking .pth file support in /Library/Python/2.7/site-packages/
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-
install-632.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Python/2.7/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://pythonhosted.org/setuptools/easy_install.html
Please make the appropriate changes for your system and try again.
它对“python3 setup.py install”命令也说了同样的话。请记住,我已经安装了 python3 并且 Yosemite 仍然在 python v2.4.7 上运行,并且我正在从文件所在的下载目录运行终端。也许我必须将文件解压缩文件更改为新位置?但基本上我很失望,因为我真的很想学习使用这些包。我知道我的朋友是否能够安装 matplotlib,我应该能够安装这些。
那么有没有办法将 pip 恢复到我的计算机并以这种方式安装?或者有人可以指出我做错了明显的事情吗?谢谢各位帮忙!