在python 3.4.1中安装numpy时出错

时间:2014-08-20 16:50:42

标签: python numpy

当我尝试使用pip安装numpy时

pip install numpy==1.8.1

我收到此错误消息 -

----------------------------------------
Cleaning up...
  Removing temporary dir C:\Users\mj\AppData\Local\Temp\pip_build_mj...
Command C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\mj\\AppData\\Local\\Temp\\pip_build_mj\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\mj\AppData\Local\Temp\pip-vq4grnqj-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in C:\Users\mj\AppData\Local\Temp\pip_build_mj\numpy
Exception information:
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "C:\Python34\lib\site-packages\pip\commands\install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "C:\Python34\lib\site-packages\pip\req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "C:\Python34\lib\site-packages\pip\req.py", line 706, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "C:\Python34\lib\site-packages\pip\util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\mj\\AppData\\Local\\Temp\\pip_build_mj\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\mj\AppData\Local\Temp\pip-vq4grnqj-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in C:\Users\mj\AppData\Local\Temp\pip_build_mj\numpy

我已经从微软的官方网站安装了VC ++。这是整体stacktrace

2 个答案:

答案 0 :(得分:1)

解决此问题的最佳方法是从 - 下载非官方二进制文件 - http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
在我的情况下,将是scipy‑0.14.0.win‑amd64‑py3.4.exe

答案 1 :(得分:1)

您可以尝试包含scipy和许多科学软件包的anaconda Python发行版:https://store.continuum.io/cshop/anaconda/