Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos OSX优胜美地10.10上的pip命令错误_Macos_Python 3.x_Scipy_Pip_Astropy - Fatal编程技术网

Macos OSX优胜美地10.10上的pip命令错误

Macos OSX优胜美地10.10上的pip命令错误,macos,python-3.x,scipy,pip,astropy,Macos,Python 3.x,Scipy,Pip,Astropy,我在MacBookAir上运行OSX Yosemite。我已经安装了python3,以及apple开发者软件包。我正在尝试安装像我已经安装的模块一样的模块,包括matplotlib。基本上,当我尝试安装SciPy、Ginga、AstroPy、iPython等科学python软件包时,我会在尝试pip安装后在终端中获得以下信息: -bash: pip: command not found 因此,我尝试下载tarball(如果提供的话),并按照网站和自述文件的指导按照说明进行安装,但仍然会出现错误

我在MacBookAir上运行OSX Yosemite。我已经安装了python3,以及apple开发者软件包。我正在尝试安装像我已经安装的模块一样的模块,包括matplotlib。基本上,当我尝试安装SciPy、Ginga、AstroPy、iPython等科学python软件包时,我会在尝试pip安装后在终端中获得以下信息:

-bash: pip: command not found
因此,我尝试下载tarball(如果提供的话),并按照网站和自述文件的指导按照说明进行安装,但仍然会出现错误。例如,在这个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仍然在Pythonv2.4.7上运行,我正在下载目录下运行终端,文件就在那里。也许我必须将文件解压后的文件更改到新位置?但基本上我很失望,因为我真的很想学习使用这些软件包。我知道如果我的朋友能够安装matplotlib,我应该能够安装这些


那么,有没有办法将pip恢复到我的计算机并以这种方式安装?或者有人能指出我做错了什么吗?谢谢大家的帮助

权限被拒绝的问题通常意味着您需要在命令前面加上sudo

下面是我写的一篇文章,其中包括用自制软件安装python:


对于阅读其他一些回复的任何人,我应该强调,您不应该使用
sudo
来绕过权限错误-而是使用以下命令运行install命令:

python setup.py install --user
这将把软件包安装到主目录中的
库中


一般来说,我建议使用在Mac上安装Scientific Python发行版(默认情况下包括Numpy、SciPy、Astropy等)。

当您使用
brew安装Python时,请安装Python
。我在Mac上运行python3。为什么我需要重新安装python?如果您使用自制软件安装python或python3,您将安装pip。看起来在安装python(3)时没有安装pip。运行
python setup.py install--user
。另外,pip命令notfound意味着您必须这样做,这将是您最好的行动方案。更好的是,只需使用自制软件,因为自己设置软件包的配置可能会很麻烦。我使用了pip3,它成功了!