无法在Msys2上安装PyMc3

时间:2019-02-06 16:55:35

标签: python pip pymc3 msys2

我在Windows 10上运行Msys2。我在mingw-w64和mingw-i686下安装了Python 3.6。我有用于Msys,mingw-w64和mingw-i686的gcc工具链。

我尝试使用pip3安装PyMc3。安装失败,并显示以下消息。

$ pip3安装pymc3 收集pymc3

使用缓存 files.pythonhosted.org/packages/51/ab/27936b914d4c1bc488c6f67abb94a851946ec3eae85b92f9039b35009a18/pymc3-3.6.tar.gz

收集theano> = 1.0.0(来自pymc3)   使用缓存的文件.pythonhosted.org / packages / 7d / c4 / 6341148ad458b6cd8361b774d7ee6895c38eab88f05331f22304c484ed5d / Theano-1.0.4.tar.gz

收集numpy> = 1.13.0(来自pymc3)   使用缓存的文件.pythonhosted.org / packages / 2b / 26 / 07472b0de91851b6656cbc86e2f0d5d3a3128e7580f23295ef58b6862d6c / numpy-1.16.1.zip

收集scipy> = 0.18.1(来自pymc3)   使用缓存的文件.pythonhosted.org / packages / ea / c8 / c296904f2c852c5c129962e6ca4ba467116b08cd5b54b7180b2e77fe06b2 / scipy-1.2.0.tar.gz

Complete output from command python setup.py egg_info:
non-existing path in 'numpy/distutils': 'site.cfg'

Could not locate executable g77
Could not locate executable f77

_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’ [-Wbuiltin-declaration-mismatch]
 int exp (void);
     ^~~
In file included from _configtest.c:1:0:
/usr/include/python3.7m/Python.h:39:10: fatal error: crypt.h: No such file or directory
 #include <crypt.h>
          ^~~~~~~~~
compilation terminated.
Running from numpy source directory.
/tmp/easy_install-cj5c3ysb/numpy-1.16.1/setup.py:390: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
  run_build = parse_setuppy_commands()
/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/system_info.py:636: UserWarning:
    Atlas libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [atlas]) or by setting
    the ATLAS environment variable.
  self.calc_info()
/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/system_info.py:636: UserWarning:
    Blas libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [blas]) or by setting
    the BLAS environment variable.
  self.calc_info()
/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/system_info.py:636: UserWarning:
    Blas sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [blas_src]) or by setting
    the BLAS_SRC environment variable.
  self.calc_info()
/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/system_info.py:636: UserWarning:
    Lapack libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [lapack]) or by setting
    the LAPACK environment variable.
  self.calc_info()
/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/system_info.py:636: UserWarning:
    Lapack sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [lapack_src]) or by setting
    the LAPACK_SRC environment variable.
  self.calc_info()
/usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
  warnings.warn(msg)
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/setup.py", line 415, in <module>
    cmdclass = {'sdist': sdist_checked}
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/setup.py", line 407, in setup_package

  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/core.py", line 171, in setup
  File "/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 140, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 163, in run
    self.run_command("egg_info")
  File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/command/egg_info.py", line 26, in run
  File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/command/build_src.py", line 148, in run
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/command/build_src.py", line 165, in build_sources
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/command/build_src.py", line 322, in build_extension_sources
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/command/build_src.py", line 375, in generate_sources
  File "numpy/core/setup.py", line 423, in generate_config_h
    try:
  File "numpy/core/setup.py", line 47, in check_types
    Programming Language :: Python :: 3.4
  File "numpy/core/setup.py", line 281, in check_types
    # below and not standalone.  Hence they're not added to good_commands.
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-pwea54zu/scipy/setup.py", line 492, in <module>
    setup_package()
  File "/tmp/pip-install-pwea54zu/scipy/setup.py", line 488, in setup_package
    setup(**metadata)
  File "/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 139, in setup
    _install_setup_requires(attrs)
  File "/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 134, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "/usr/lib/python3.7/site-packages/setuptools/dist.py", line 514, in fetch_build_eggs
    replace_conflicting=True,
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 777, in resolve
    replace_conflicting=replace_conflicting
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1060, in best_match
    return self.obtain(req, installer)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1072, in obtain
    return installer(requirement)
  File "/usr/lib/python3.7/site-packages/setuptools/dist.py", line 581, in fetch_build_egg
    return cmd.easy_install(req)
  File "/usr/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 676, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 702, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 887, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 1155, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 1141, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
    raise
  File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "/usr/lib/python3.7/site-packages/setuptools/_vendor/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/usr/lib/python3.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/setup.py", line 415, in <module>
    cmdclass = {'sdist': sdist_checked}
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/setup.py", line 407, in setup_package

  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/core.py", line 171, in setup
  File "/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 140, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 163, in run
    self.run_command("egg_info")
  File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/command/egg_info.py", line 26, in run
  File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/command/build_src.py", line 148, in run
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/command/build_src.py", line 165, in build_sources
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/command/build_src.py", line 322, in build_extension_sources
  File "/tmp/easy_install-cj5c3ysb/numpy-1.16.1/numpy/distutils/command/build_src.py", line 375, in generate_sources
  File "numpy/core/setup.py", line 423, in generate_config_h
    try:
  File "numpy/core/setup.py", line 47, in check_types
    Programming Language :: Python :: 3.4
  File "numpy/core/setup.py", line 281, in check_types
    # below and not standalone.  Hence they're not added to good_commands.
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

尽管消息显示“ ...您需要安装python-dev | python-devel”,但该 stackoverflow 响应(请参阅最后的注释)指出Msys2没有单独的dev或devel库。

我的Msys2中都没有找到上面消息说的Atlas,Blas和Lapack库。

我是使用Msys2的新手,所以我有点迷路。预先感谢

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。对我来说,这是由编译器以某种方式选择了MSYS Python.h文件而不是MinGW文件引起的。我通过删除python软件包并安装了mingw-w64-x86_64-python3来解决了我的问题。