【问题标题】:Unable to install pycuda on Mac OS X EL Capitan无法在 Mac OS X EL Capitan 上安装 pycuda
【发布时间】:2016-01-26 21:19:52
【问题描述】:

我正在尝试在我的 macbook pro 上安装 pycuda-2015.1.3。

我已经成功安装了 CUDA,我正在使用 python 3.4。

进入终端并进入pycuda文件夹后,我点击“sudo make”并得到以下输出:

ctags -R src || true
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
/usr/local/bin/python3.4 setup.py build
---------------------------------------------------------------------------
Sorry, your build failed. Try rerunning configure.py with different options.
---------------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2421, in _dep_map
    return self.__dep_map
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2283, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2412, in _parsed_pkg_info
    return self._pkg_info
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2283, in __getattr__
    raise AttributeError(attr)
AttributeError: _pkg_info

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 229, in <module>
    main()
  File "setup.py", line 225, in main
    cmdclass={'build_py': build_py})
  File "/Users/shirgur/Downloads/pycuda-2015.1.3/aksetup_helper.py", line 23, in setup
    setup(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/setuptools/dist.py", line 239, in __init__
    self.fetch_build_eggs(attrs.pop('setup_requires'))
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/setuptools/dist.py", line 263, in fetch_build_eggs
    parse_requirements(requires), installer=self.fetch_build_egg
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 577, in resolve
    requirements.extend(dist.requires(req.extras)[::-1])
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2232, in requires
    dm = self._dep_map
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2423, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2445, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2415, in _parsed_pkg_info
    self._pkg_info = Parser().parsestr(self.get_metadata(self.PKG_INFO))
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 1310, in get_metadata
    return self._get(self._fn(self.egg_info,name)).decode("utf-8")
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 1414, in _get
    stream = open(path, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/Users/shirgur/Library/Python/3.4/lib/python/site-packages/numpy-1.9.1.dist-info/METADATA'
make: *** [all] Error 1

【问题讨论】:

  • 这看起来很可疑,就像您没有安装 numpy。
  • 嗯,我有,它适用于 python 3.4:/
  • 对不起,你是对的。这是 numpy 问题:卸载 >> 安装
  • 请将此作为答案添加到未回答的问题列表中

标签: python python-3.4 osx-elcapitan pycuda


【解决方案1】:

我有两个版本的 numpy。

在“pip uninstall numpy”并删除所有 1.9 文件后,我从头开始安装颠簸。

就是这样!

【讨论】: