0
votes

I'm running Msys2 on Windows 10. I have Python 3.6 installed under with mingw-w64 as well as mingw-i686. I have the gcc tool chain for Msys, mingw-w64, and mingw-i686.

I tried to install PyMc3 using pip3. The installation failed with the following messages.

$ pip3 install pymc3 Collecting pymc3

Using cached files.pythonhosted.org/packages/51/ab/27936b914d4c1bc488c6f67abb94a851946ec3eae85b92f9039b35009a18/pymc3-3.6.tar.gz

Collecting theano>=1.0.0 (from pymc3) Using cached files.pythonhosted.org/packages/7d/c4/6341148ad458b6cd8361b774d7ee6895c38eab88f05331f22304c484ed5d/Theano-1.0.4.tar.gz

Collecting numpy>=1.13.0 (from pymc3) Using cached files.pythonhosted.org/packages/2b/26/07472b0de91851b6656cbc86e2f0d5d3a3128e7580f23295ef58b6862d6c/numpy-1.16.1.zip

Collecting scipy>=0.18.1 (from pymc3) Using cached files.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.

Although the message says "... you need to install python-dev | python-devel" this stackoverflow response (see the very last note) says that Msys2 has no separate dev or devel libraries.

The Atlas, Blas, and Lapack libraries which the message above says are not found are all there in my Msys2.

I'm new at using Msys2, so I'm a bit lost. Thanks in advance

1
Unfortunately, it doesn't seem like you're getting an answer here. If you'll suffer my opinion for a moment: MSYS2 sounds like more trouble than it's worth. I no longer run Windows, but used to run Cygwin when I did. If I was returning to that ecosystem, I wouldn't even bother with such POSIX layers and go straight to Miniconda. It's a clean, easy to manage solution that covers installation for most data science related software (and their dependencies).merv

1 Answers

1
votes

I've had the same issue. For me it was caused by the compiler somehow picking up the MSYS Python.h file instead of the MinGW one. I solved my problem by removing the python package and installing mingw-w64-x86_64-python3 instead.