Python 在 Pycharm 中安装包

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19364703/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 13:33:42  来源:igfitidea点击:

install packages in Pycharm

pythonpackagepycharm

提问by tcquant

I installed PyCharm Community Edition 3.0 on windows 7 machine; and tried to install some common packages, like numpy, scipy...

我在 Windows 7 机器上安装了 PyCharm Community Edition 3.0;并尝试安装一些常见的软件包,例如 numpy、scipy ...

I followed exactly the instruction from the JetBrains website http://www.jetbrains.com/pycharm/webhelp/installing-uninstalling-and-upgrading-packages.html

我完全按照 JetBrains 网站http://www.jetbrains.com/pycharm/webhelp/installing-uninstalling-and-upgrading-packages.html的说明进行操作

but the installation always fails...

但是安装总是失败...

"Install packages failed: Error occurred when installing package numpy...."

“安装包失败:安装包numpy时发生错误......”

  Running setup.py egg_info for package numpy
    Forcing DISTUTILS_USE_SDK=1
    non-existing path in 'numpy\distutils': 'site.cfg'
    F2PY Version 2
    blas_opt_info:
    blas_mkl_info:
      libraries mkl,vml,guide not found in ['C:\Python27\lib', 'C:\', 'C:\Python27\libs']
      NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in ['C:\Python27\lib', 'C:\', 'C:\Python27\libs']
  NOT AVAILABLE

atlas_blas_info:
  libraries f77blas,cblas,atlas not found in ['C:\Python27\lib', 'C:\', 'C:\Python27\libs']
  NOT AVAILABLE

blas_info:
  libraries blas not found in ['C:\Python27\lib', 'C:\', 'C:\Python27\libs']
  NOT AVAILABLE

blas_src_info:
  NOT AVAILABLE

  NOT AVAILABLE

lapack_opt_info:
lapack_mkl_info:
mkl_info:
  libraries mkl,vml,guide not found in ['C:\Python27\lib', 'C:\', 'C:\Python27\libs']
  NOT AVAILABLE

  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in C:\Python27\lib
  libraries lapack_atlas not found in C:\Python27\lib
  libraries ptf77blas,ptcblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries ptf77blas,ptcblas,atlas not found in C:\Python27\libs
  libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_threads_info
  NOT AVAILABLE

atlas_info:
  libraries f77blas,cblas,atlas not found in C:\Python27\lib
  libraries lapack_atlas not found in C:\Python27\lib
  libraries f77blas,cblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\
  libraries f77blas,cblas,atlas not found in C:\Python27\libs
  libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_info
  NOT AVAILABLE

lapack_info:
  libraries lapack not found in ['C:\Python27\lib', 'C:\', 'C:\Python27\libs']
  NOT AVAILABLE

lapack_src_info:
  NOT AVAILABLE

  NOT AVAILABLE

采纳答案by Games Brainiac

You cannot install numpyand scipylike this. Depending on your build and Python version, install it from here.

你不能安装numpyscipy喜欢这个。根据您的构建和 Python 版本,从这里安装它。

回答by user2551828

For about 3 years, I have been using PyCharm as my Python IDE of choice. It is weird, and annoying, but often true, that you will frequently be unable to use PyCharm to install many packages. This has happened enough times with me that I just stopped using PyCharm to install packages. With a Mac, I install packages using MacPorts. With Windows 7, I download packages from the Unofficial Windows Binary site mentioned above by Games Brainiac.

大约 3 年来,我一直使用 PyCharm 作为我的 Python IDE 选择。您经常无法使用 PyCharm 安装许多软件包,这很奇怪,也很烦人,但通常是这样。这在我身上发生的次数已经够多了,我只是停止使用 PyCharm 来安装软件包。对于 Mac,我使用 MacPorts 安装软件包。对于 Windows 7,我从上面由 Games Brainiac 提到的非官方 Windows 二进制站点下载软件包。

回答by Rausta

I had this same issue trying to install numpy 1.9.2 for python 3.4 (most recent version at 02/04/2015) I managed to fix this by downloading the .exe from http://sourceforge.net/projects/numpy/files/NumPy/1.9.2/numpy-1.9.2-win32-superpack-python3.4.exe/downloadand now I can use Numpy in pycharm

我在尝试为 python 3.4 安装 numpy 1.9.2(02/04/2015 的最新版本)时遇到了同样的问题,我设法通过从http://sourceforge.net/projects/numpy/files下载 .exe 来解决这个问题/NumPy/1.9.2/numpy-1.9.2-win32-superpack-python3.4.exe/download现在我可以在 pycharm 中使用 Numpy

Hope this helps!

希望这可以帮助!

I'm also using Windows 10 TP so I'm guessing this should work on Win7/8/8.1 aswel

我也在使用 Windows 10 TP 所以我猜这应该适用于 Win7/8/8.1 aswel

回答by Darshan

Download executable file of numpy from http://sourceforge.net/projects/numpy/files/NumPy/1.9.2/numpy-1.9.2-win32-superpack-python3.4.exe/download

http://sourceforge.net/projects/numpy/files/NumPy/1.9.2/numpy-1.9.2-win32-superpack-python3.4.exe/download下载 numpy 的可执行文件

It works for Window 7 also.

它也适用于 Window 7。

Thanks Rausta

谢谢劳斯塔

回答by InLaw

If you created an virtual environment to work in you still can install like "normal" with pip:

如果您创建了一个虚拟环境来工作,您仍然可以像“正常”一样使用 pip 进行安装:

lsvirtualenv # check that a virtual environment exists

my_project_folder_VE="/home/${USER}/.virtualenvs" 
my_project="TDD"
cd ${my_project_folder_VE}

source ${my_project}/bin/activate
lssitepackages # check for installed packages

pip install requests numpy pandas

PyCharm will right away update the projects index and you can

PyCharm 将立即更新项目索引,您可以

import pandas as pd