You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
0.8.0rc1 implicitly requires numpy to be pre-installed #3207
[jwm@hobbes:s002 ~> pip install statsmodels==0.8.0rc1
You are using pip version 7.1.0, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting statsmodels==0.8.0rc1 (from -r requirements.txt (line 1))
Using cached statsmodels-0.8.0rc1.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/private/var/folders/8h/7_y8y9rx32jfrn52rl35l2080000gn/T/pip-build-fbiaSB/statsmodels/setup.py", line 330, in <module>
from numpy.distutils.misc_util import get_info
ImportError: No module named numpy.distutils.misc_util
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/8h/7_y8y9rx32jfrn52rl35l2080000gn/T/pip-build-fbiaSB/statsmodels
This is especially problematic for applications that declare dependencies using a requirements.txt, since that file may include numpy, but it won't necessarily be completely installed before statsmodels.
This change was introduced in 0.8.0rc1 (8a1a0b9). scipy seems to have a reasonably elegant way of addressing this. If numpy isn't already present, it declares numpy as a setup dependency.
Reacted by Blake Peterman, Tom Plagge, Pablo, fred271828, Ben Mosher, Jeff Yunes, Nikolas Rieble, Nitin Madnani and zengqingfu1442
Hm, not seeing that work with a fresh virtualenv and statsmodels 0.8.0:
(foo)[jwm@hobbes:s000 ~> virtualenv foo
New python executable in foo/bin/python2.7
Also creating executable in foo/bin/python
Installing setuptools, pip, wheel...done.
(foo)[jwm@hobbes:s000 ~> . foo/bin/activate
(foo)[jwm@hobbes:s000 ~> pip list | grep -i numpy
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(foo)[jwm@hobbes:s000 ~> pip install statsmodels==0.8.0
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting statsmodels==0.8.0
Using cached statsmodels-0.8.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/private/var/folders/8h/7_y8y9rx32jfrn52rl35l2080000gn/T/pip-build-RuoYtU/statsmodels/setup.py", line 335, in <module>
from numpy.distutils.misc_util import get_info
ImportError: No module named numpy.distutils.misc_util
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/8h/7_y8y9rx32jfrn52rl35l2080000gn/T/pip-build-RuoYtU/statsmodels
Looks like the problem is still prevalent if building from src. There are wheels on pypi for python27 on linux/Mac 64bit, maybe you are 32bit or using windows?
I encountered this problem when attempting to install the latest version of numpy and statsmodels from the public pypi mirror:
$ virtualenv env
New python executable in env/bin/python2
Also creating executable in env/bin/python
Installing setuptools, pip...done.
$ source env/bin/activate
$ echo "numpy
statsmodels" > requirements.txt
$ pip install -i https://pypi.python.org/simple -r requirements.txt
Downloading/unpacking numpy (from -r requirements.txt (line 1))
Creating supposed download cache at /home/user/.pip/cache
Storing download in cache at ./.pip/cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2F05%2F84%2F0feb999c05f252af50a5fbc463268044feda92cdaad8cb0d0a6073d76057%2Fnumpy-1.13.0.zip
Running setup.py (path:/tmp/pip-build-SBFo6g/numpy/setup.py) egg_info for package numpy
Running from numpy source directory.
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
Downloading/unpacking statsmodels (from -r requirements.txt (line 2))
Storing download in cache at ./.pip/cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2F72%2F16%2Fd7e7a70fc8ca3cc0d783a66e902a7adf80a810695c357cd48bb22c82451a%2Fstatsmodels-0.8.0.tar.gz
Running setup.py (path:/tmp/pip-build-SBFo6g/statsmodels/setup.py) egg_info for package statsmodels
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-SBFo6g/statsmodels/setup.py", line 335, in <module>
from numpy.distutils.misc_util import get_info
ImportError: No module named numpy.distutils.misc_util
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-SBFo6g/statsmodels/setup.py", line 335, in <module>
from numpy.distutils.misc_util import get_info
ImportError: No module named numpy.distutils.misc_util
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-SBFo6g/statsmodels
Storing debug log for failure in /home/user/.pip/pip.log
Older versions of pip appear to have trouble installing from wheels. The run above was using pip 1.5.6. Running pip install --upgrade pip fixed the issue for me, because it was then able to install from the wheel properly.
For those stuck on older versions of pip, or on platforms without wheels available, are there plans to merge #3195? It looks like that would fix this issue for everyone.
That doesn't work for me. My actual use case is including ggplot as a 'install_requires' in my setup.py, and ggplot lists statsmodels as a dependency. This fails:
Moving ggplot to after numpy in the list failed to fix this problem because numpy was downloaded but not fully installed (and available) in the virtual environment before your setup.py executes and requests numpy.
This works for me:
from setuptools import setup, find_packages
setup(
name='statsmodels.test',
install_requires=[
'statsmodels!=0.9.0',
# Or 'statsmodels==0.8.0',
'ggplot'
]
)
The standard simple solution is to avoid importing any dependencies in your setup.py, but I'm guessing you had very good reasons for breaking that guideline. If numpy is optional, you could wrap its import in a try: statement (a PR I offered other developers who had a similar problem as you).
I personally don't know of another way to let you import dependencies in setup.py without breaking pip dependency management. Unfortunately, your workaround of manual non-standard installation is a deal breaker in my applications. If you find another solution for this chicken-and-egg situation, I'd be interested to learning it. This is the second package I've encountered with this type of installation error, and I'm expecting to find more in the future.
We, or better, pip install seems to have two steps:
discovery of dependencies: during collection we don't need numpy and we could just run check_dependency_versions to see what's already installed and populate the "requires" if missing.
for cythonizing for sdist and for compiling we need numpy and scipy, so we can create numpy and scipy compatible C files and binary files.
The second steps are currently in the main setup.py module code and break if numpy is not installed. If we know what triggers cythonizing and compilation, then we could hide the extension definition in a function and avoid calling that part during the discovery/collection part.
But I have no idea how to do that. Based on the comments, #3195 does not handle this correctly yet.
And I have no idea why this works with 0.8 if it doesn't work with 0.9.
Linux and Apple wheels should be coming over the next days.
Wheels don't have the setup.py importing numpy problem, but we have a separate issue that wheels don't specify requirements, i.e. pandas and patsy still have to be separately specified as requirement which in turn should also add numpy and scipy. #4638
Does this issue fixed already? I still have this issue when use pip to install statsmodels==0.10.0 on alpine:3.14.
bash-5.1# python2.7 -m pip install statsmodels==0.10.0
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting statsmodels==0.10.0
Downloading statsmodels-0.10.0.tar.gz (14.0 MB)
|████████████████████████████████| 14.0 MB 6.0 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-Nu3H9h/statsmodels/setup.py'"'"'; __file__='"'"'/tmp/pip-install-Nu3H9h/statsmodels/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-IdPys2
cwd: /tmp/pip-install-Nu3H9h/statsmodels/
Complete output (52 lines):
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-hU3nWo/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-hU3nWo/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ZW4H1H
cwd: /tmp/pip-wheel-hU3nWo/scipy/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-wheel-hU3nWo/scipy/setup.py", line 492, in <module>
setup_package()
File "/tmp/pip-wheel-hU3nWo/scipy/setup.py", line 468, in setup_package
from numpy.distutils.core import setup
ImportError: No module named numpy.distutils.core
----------------------------------------
ERROR: Failed building wheel for scipy
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-hU3nWo/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-hU3nWo/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
cwd: /tmp/pip-wheel-hU3nWo/scipy
Complete output (9 lines):
`setup.py clean` is not supported, use one of the following instead:
- `git clean -xdf` (cleans all files)
- `git clean -Xdf` (cleans all versioned files, doesn't touch
files that aren't checked into the git repo)
Add `--force` to your command to use it anyway if you must (unsupported).
----------------------------------------
ERROR: Failed cleaning build dir for scipy
ERROR: Failed to build one or more wheels
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-Nu3H9h/statsmodels/setup.py", line 346, in <module>
data_files=[('', ['LICENSE.txt', 'setup.cfg'])]
File "/usr/lib/python2.7/site-packages/setuptools/__init__.py", line 161, in setup
_install_setup_requires(attrs)
File "/usr/lib/python2.7/site-packages/setuptools/__init__.py", line 156, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 721, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
replace_conflicting=replace_conflicting
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
return installer(requirement)
File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 777, in fetch_build_egg
return fetch_build_egg(self, req)
File "/usr/lib/python2.7/site-packages/setuptools/installer.py", line 130, in fetch_build_egg
raise DistutilsError(str(e))
distutils.errors.DistutilsError: Command '['/usr/bin/python2.7', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpH31Aqa', '--quiet', 'scipy>=0.18']' returned non-zero exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output
bash-5.1# python2.7 -m pip install numpy
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Processing /root/.cache/pip/wheels/fe/49/d9/dbd8037d1f7b1672ebcdba0c75f1b7000d9e888a33af294c35/numpy-1.16.6-cp27-cp27mu-linux_x86_64.whl
Installing collected packages: numpy
Successfully installed numpy-1.16.6
bash-5.1# python2.7 -m pip install statsmodels
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting statsmodels
Using cached statsmodels-0.11.0.tar.gz (15.4 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2.7 /usr/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-A_gmtq/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.29.14' 'numpy==1.14.5; python_version=='"'"'3.5'"'"'' 'numpy==1.14.5; python_version=='"'"'3.6'"'"'' 'numpy==1.14.5; python_version>='"'"'3.7'"'"'' 'numpy==1.17.5; python_version>='"'"'3.8'"'"'' 'scipy>=1.0'
cwd: None
Complete output (311 lines):
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Ignoring numpy: markers 'python_version == "3.5"' don't match your environment
Ignoring numpy: markers 'python_version == "3.6"' don't match your environment
Ignoring numpy: markers 'python_version >= "3.7"' don't match your environment
Ignoring numpy: markers 'python_version >= "3.8"' don't match your environment
Collecting setuptools
Using cached setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
Collecting wheel
Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting cython>=0.29.14
Using cached Cython-0.29.24-py2.py3-none-any.whl (979 kB)
Collecting scipy>=1.0
Using cached scipy-1.2.3.tar.gz (23.3 MB)
Building wheels for collected packages: scipy
Building wheel for scipy (setup.py): started
Building wheel for scipy (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qjbcVy/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qjbcVy/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-iHoKxH
cwd: /tmp/pip-install-qjbcVy/scipy/
Complete output (127 lines):
Running from scipy source directory.
lapack_opt_info:
lapack_mkl_info:
customize UnixCCompiler
libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
NOT AVAILABLE
openblas_lapack_info:
customize UnixCCompiler
customize UnixCCompiler
libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
NOT AVAILABLE
openblas_clapack_info:
customize UnixCCompiler
customize UnixCCompiler
libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
NOT AVAILABLE
atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries tatlas,tatlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries tatlas,tatlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/
customize UnixCCompiler
libraries tatlas,tatlas not found in /usr/lib/
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
NOT AVAILABLE
atlas_3_10_info:
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries satlas,satlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries satlas,satlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/
customize UnixCCompiler
libraries satlas,satlas not found in /usr/lib/
<class 'numpy.distutils.system_info.atlas_3_10_info'>
NOT AVAILABLE
atlas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries ptf77blas,ptcblas,atlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/
customize UnixCCompiler
libraries ptf77blas,ptcblas,atlas not found in /usr/lib/
<class 'numpy.distutils.system_info.atlas_threads_info'>
NOT AVAILABLE
atlas_info:
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries f77blas,cblas,atlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries f77blas,cblas,atlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/
customize UnixCCompiler
libraries f77blas,cblas,atlas not found in /usr/lib/
<class 'numpy.distutils.system_info.atlas_info'>
NOT AVAILABLE
accelerate_info:
NOT AVAILABLE
/usr/lib/python2.7/site-packages/numpy/distutils/system_info.py:639: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) 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()
lapack_info:
customize UnixCCompiler
libraries lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
NOT AVAILABLE
/usr/lib/python2.7/site-packages/numpy/distutils/system_info.py:639: UserWarning:
Lapack (http://www.netlib.org/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()
lapack_src_info:
NOT AVAILABLE
/usr/lib/python2.7/site-packages/numpy/distutils/system_info.py:639: UserWarning:
Lapack (http://www.netlib.org/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()
NOT AVAILABLE
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-qjbcVy/scipy/setup.py", line 492, in <module>
setup_package()
File "/tmp/pip-install-qjbcVy/scipy/setup.py", line 488, in setup_package
setup(**metadata)
File "/usr/lib/python2.7/site-packages/numpy/distutils/core.py", line 137, in setup
config = configuration()
File "/tmp/pip-install-qjbcVy/scipy/setup.py", line 395, in configuration
raise NotFoundError(msg)
numpy.distutils.system_info.NotFoundError: No lapack/blas resources found.
----------------------------------------
ERROR: Failed building wheel for scipy
Running setup.py clean for scipy
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qjbcVy/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qjbcVy/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
cwd: /tmp/pip-install-qjbcVy/scipy
Complete output (9 lines):
`setup.py clean` is not supported, use one of the following instead:
- `git clean -xdf` (cleans all files)
- `git clean -Xdf` (cleans all versioned files, doesn't touch
files that aren't checked into the git repo)
Add `--force` to your command to use it anyway if you must (unsupported).
----------------------------------------
ERROR: Failed cleaning build dir for scipy
Failed to build scipy
Installing collected packages: setuptools, wheel, cython, scipy
Running setup.py install for scipy: started
Running setup.py install for scipy: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qjbcVy/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qjbcVy/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-8DLdMS/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-A_gmtq/overlay --compile --install-headers /tmp/pip-build-env-A_gmtq/overlay/include/python2.7/scipy
cwd: /tmp/pip-install-qjbcVy/scipy/
Complete output (136 lines):
Note: if you need reliable uninstall behavior, then install
with pip instead of using `setup.py install`:
- `pip install .` (from a git repo or downloaded source
release)
- `pip install scipy` (last SciPy release on PyPI)
Running from scipy source directory.
lapack_opt_info:
lapack_mkl_info:
customize UnixCCompiler
libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
NOT AVAILABLE
openblas_lapack_info:
customize UnixCCompiler
customize UnixCCompiler
libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
NOT AVAILABLE
openblas_clapack_info:
customize UnixCCompiler
customize UnixCCompiler
libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
NOT AVAILABLE
atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries tatlas,tatlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries tatlas,tatlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/
customize UnixCCompiler
libraries tatlas,tatlas not found in /usr/lib/
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
NOT AVAILABLE
atlas_3_10_info:
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries satlas,satlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries satlas,satlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/
customize UnixCCompiler
libraries satlas,satlas not found in /usr/lib/
<class 'numpy.distutils.system_info.atlas_3_10_info'>
NOT AVAILABLE
atlas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries ptf77blas,ptcblas,atlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/
customize UnixCCompiler
libraries ptf77blas,ptcblas,atlas not found in /usr/lib/
<class 'numpy.distutils.system_info.atlas_threads_info'>
NOT AVAILABLE
atlas_info:
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries f77blas,cblas,atlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries f77blas,cblas,atlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/
customize UnixCCompiler
libraries f77blas,cblas,atlas not found in /usr/lib/
<class 'numpy.distutils.system_info.atlas_info'>
NOT AVAILABLE
accelerate_info:
NOT AVAILABLE
/usr/lib/python2.7/site-packages/numpy/distutils/system_info.py:639: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) 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()
lapack_info:
customize UnixCCompiler
libraries lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
NOT AVAILABLE
/usr/lib/python2.7/site-packages/numpy/distutils/system_info.py:639: UserWarning:
Lapack (http://www.netlib.org/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()
lapack_src_info:
NOT AVAILABLE
/usr/lib/python2.7/site-packages/numpy/distutils/system_info.py:639: UserWarning:
Lapack (http://www.netlib.org/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()
NOT AVAILABLE
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-qjbcVy/scipy/setup.py", line 492, in <module>
setup_package()
File "/tmp/pip-install-qjbcVy/scipy/setup.py", line 488, in setup_package
setup(**metadata)
File "/usr/lib/python2.7/site-packages/numpy/distutils/core.py", line 137, in setup
config = configuration()
File "/tmp/pip-install-qjbcVy/scipy/setup.py", line 395, in configuration
raise NotFoundError(msg)
numpy.distutils.system_info.NotFoundError: No lapack/blas resources found.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python2.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qjbcVy/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qjbcVy/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-8DLdMS/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-A_gmtq/overlay --compile --install-headers /tmp/pip-build-env-A_gmtq/overlay/include/python2.7/scipy Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python2.7 /usr/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-A_gmtq/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.29.14' 'numpy==1.14.5; python_version=='"'"'3.5'"'"'' 'numpy==1.14.5; python_version=='"'"'3.6'"'"'' 'numpy==1.14.5; python_version>='"'"'3.7'"'"'' 'numpy==1.17.5; python_version>='"'"'3.8'"'"'' 'scipy>=1.0' Check the logs for full command output.
There is no support for 2.7 available from statsmodels developers. If you need 2.7 you will need to find an alternative source of support. We strongly recommend that anyone using statsmodels, or numerical python in general, uses 3.8 or newer.
Don't use alpine? IIRC alpine can't use standard wheels. I suspect you are having problems building NumPy and especially SciPy which are requirements. Can you get NumPy, SciPy, pandas and Cython all installed in your python 3.9? If you, you can install statsmodels from source.
Activity
josef-pkt commentedon Sep 22, 2016
It looks like this would be solved by #3195
I thought we do something similar to scipy already.
However, I'm not really up to date on how our setup.py and requirements currently work.
bpeterman commentedon Dec 15, 2016
I'm also having an issue with this when declaring dependencies using a requirements.txt
ciarancourtney commentedon Feb 13, 2017
This appears to be fixed in 0.8.0
jwm commentedon Feb 13, 2017
Hm, not seeing that work with a fresh
virtualenvand statsmodels 0.8.0:ciarancourtney commentedon Feb 13, 2017
Looks like the problem is still prevalent if building from src. There are wheels on pypi for python27 on linux/Mac 64bit, maybe you are 32bit or using windows?
0.8.0rc1 probably failed for me because only windows wheels were available https://pypi.python.org/pypi/statsmodels/0.8.0rc1
markyen commentedon Jun 23, 2017
I encountered this problem when attempting to install the latest version of numpy and statsmodels from the public pypi mirror:
Older versions of pip appear to have trouble installing from wheels. The run above was using pip 1.5.6. Running
pip install --upgrade pipfixed the issue for me, because it was then able to install from the wheel properly.For those stuck on older versions of pip, or on platforms without wheels available, are there plans to merge #3195? It looks like that would fix this issue for everyone.
KFoxder commentedon Sep 30, 2017
Is anyone planning on fixing this?
josef-pkt commentedon Sep 30, 2017
I'm waiting for an "all clear to merge" for #3195
I'm not an expert in this area anymore
josiahjohnston commentedon May 16, 2018
I'm getting this bug in v0.9.0, running python 2.7.12, pip 10.0.1, Ubuntu 16.04. Downgrading to v0.8.0 addresses it and is my current workaround.
josef-pkt commentedon May 16, 2018
@josiahjohnston The workaround should be to install numpy before installing pypi.
I don't think there were any changes to this compared to 0.8.
josiahjohnston commentedon May 16, 2018
That doesn't work for me. My actual use case is including ggplot as a 'install_requires' in my setup.py, and ggplot lists statsmodels as a dependency. This fails:
This fails too (I tried it before my initial post):
Moving ggplot to after numpy in the list failed to fix this problem because numpy was downloaded but not fully installed (and available) in the virtual environment before your setup.py executes and requests numpy.
This works for me:
The standard simple solution is to avoid importing any dependencies in your setup.py, but I'm guessing you had very good reasons for breaking that guideline. If numpy is optional, you could wrap its import in a
try:statement (a PR I offered other developers who had a similar problem as you).I personally don't know of another way to let you import dependencies in setup.py without breaking pip dependency management. Unfortunately, your workaround of manual non-standard installation is a deal breaker in my applications. If you find another solution for this chicken-and-egg situation, I'd be interested to learning it. This is the second package I've encountered with this type of installation error, and I'm expecting to find more in the future.
Best of luck!
josef-pkt commentedon May 17, 2018
My problem is that I have no idea how pip works.
We, or better, pip install seems to have two steps:
check_dependency_versionsto see what's already installed and populate the "requires" if missing.The second steps are currently in the main setup.py module code and break if numpy is not installed. If we know what triggers cythonizing and compilation, then we could hide the extension definition in a function and avoid calling that part during the discovery/collection part.
But I have no idea how to do that. Based on the comments, #3195 does not handle this correctly yet.
And I have no idea why this works with 0.8 if it doesn't work with 0.9.
josiahjohnston commentedon May 17, 2018
Just checked my terminal. Looks like statsmodels-0.8.0 came from a wheel
But statsmodels-0.9.0 comes from a tarball which presumably needs to be compiled.
Maybe precompiling wheels for the most common platforms can be a workaround?
josef-pkt commentedon May 17, 2018
Linux and Apple wheels should be coming over the next days.
Wheels don't have the setup.py importing numpy problem, but we have a separate issue that wheels don't specify requirements, i.e. pandas and patsy still have to be separately specified as requirement which in turn should also add numpy and scipy. #4638
TST: Adjust appveyor tolerance
TST: Adjust appveyor tolerance
TST: Adjust appveyor tolerance
TST: Adjust appveyor tolerance
zengqingfu1442 commentedon Aug 2, 2021
Does this issue fixed already? I still have this issue when use pip to install
statsmodels==0.10.0onalpine:3.14.bashtage commentedon Aug 2, 2021
0.8 is complutely unsupported. This has not been an issue for a number of releases, and we always recommend upgrading to the latest release.
zengqingfu1442 commentedon Aug 2, 2021
I directly use pip to install
statsmodels==0.10.0onalpine:3.14but failed.bashtage commentedon Aug 2, 2021
Try statsmodels 0.12.2.
zengqingfu1442 commentedon Aug 3, 2021
But the latest version for python 2.7 is
0.11.0.bashtage commentedon Aug 3, 2021
There is no support for 2.7 available from statsmodels developers. If you need 2.7 you will need to find an alternative source of support. We strongly recommend that anyone using statsmodels, or numerical python in general, uses 3.8 or newer.
zengqingfu1442 commentedon Aug 3, 2021
@bashtage But I try to use
python3.9 -m pip install statsmodels==0.12.2onalpine:3.14, it still failed.bashtage commentedon Aug 3, 2021
Don't use alpine? IIRC alpine can't use standard wheels. I suspect you are having problems building NumPy and especially SciPy which are requirements. Can you get NumPy, SciPy, pandas and Cython all installed in your python 3.9? If you, you can install statsmodels from source.
bashtage commentedon Aug 3, 2021
Read this https://pythonspeed.com/articles/alpine-docker-python/ to understand why Alpine is such a pain to use with Python.