软件包只在Python 2.7中安装,但在3.5中没有安装

时间:2022-06-17 04:24:20

i'm using pip to install the packages I need: Numpy & Scipy. However, they only work if I import them using python 2.7. When I try doing in with 3.5 it seems as if it wasn't installed at all.

我正在使用pip来安装我需要的软件包:Numpy&Scipy。但是,它们只有在我使用python 2.7导入它们时才有效。当我尝试使用3.5时,似乎根本没有安装。

I updated pip and got its version pip 8.0.2 from /Library/Python/2.7/site-packages (python 2.7) then I tried: pip3.5 --version and got:

我更新了pip并从/Library/Python/2.7/site-packages(python 2.7)获得了它的版本pip 8.0.2然后我尝试了:pip3.5 --version并获得:

pip 8.0.2 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-
packages (python 3.5)

All I want is that all packages I download, I can use them with Python 3.5. I don't use 2.7 but I don't want to delete it because I read it's not such a good idea.

我想要的只是我下载的所有软件包,我可以在Python 3.5中使用它们。我不使用2.7,但我不想删除它,因为我读它并不是一个好主意。

Can anyone explain me how can I install the packages for them to work on 3.5 and not only in 2.7, please?

任何人都可以解释我如何安装他们在3.5上工作的包,而不仅仅是在2.7,请?

Thank you very much in advance for reading :) and useful help.

非常感谢您提前阅读:)和有用的帮助。

PS: Im using OS X 10.9.5

PS:我使用OS X 10.9.5

1 个解决方案

#1


14  

Packages for Python 2 and Python 3 are installed separately, and installing in one version won't make a package available to the other. pip is Python 2, and so it only installs for Python 2; to install packages for Python 3, use pip3.

Python 2和Python 3的软件包是分开安装的,在一个版本中安装不会使另一个软件包可用。 pip是Python 2,所以它只安装Python 2;要安装Python 3的软件包,请使用pip3。

#1


14  

Packages for Python 2 and Python 3 are installed separately, and installing in one version won't make a package available to the other. pip is Python 2, and so it only installs for Python 2; to install packages for Python 3, use pip3.

Python 2和Python 3的软件包是分开安装的,在一个版本中安装不会使另一个软件包可用。 pip是Python 2,所以它只安装Python 2;要安装Python 3的软件包,请使用pip3。