-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.8.0rc1 implicitly requires numpy to be pre-installed #3207
Comments
It looks like this would be solved by #3195 However, I'm not really up to date on how our setup.py and requirements currently work. |
I'm also having an issue with this when declaring dependencies using a requirements.txt |
This appears to be fixed in 0.8.0
|
Hm, not seeing that work with a fresh
|
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 |
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 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. |
Is anyone planning on fixing this? |
I'm waiting for an "all clear to merge" for #3195 |
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.
|
@josiahjohnston The workaround should be to install numpy before installing pypi. |
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 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! |
My problem is that I have no idea how pip works. We, or better, pip install seems to have two steps:
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. |
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? |
Linux and Apple wheels should be coming over the next days. |
Re-enable xdist Small adjustment for windows testing closes statsmodels#4635 closes statsmodels#4638 closes statsmodels#4651 closes statsmodels#4654 closes statsmodels#3207 closes statsmodels#3195 closes statsmodels#3977
Re-enable xdist Small adjustment for windows testing closes statsmodels#4635 closes statsmodels#4638 closes statsmodels#4651 closes statsmodels#4654 closes statsmodels#3207 closes statsmodels#3195 closes statsmodels#3977
Re-enable xdist Small adjustment for windows testing closes statsmodels#4635 closes statsmodels#4638 closes statsmodels#4651 closes statsmodels#4654 closes statsmodels#3207 closes statsmodels#3195 closes statsmodels#3977
Does this issue fixed already? I still have this issue when use pip to install
|
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. |
I directly use pip to install
|
Try statsmodels 0.12.2. |
But the latest version for python 2.7 is
|
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. |
@bashtage But I try to use |
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. |
Read this https://pythonspeed.com/articles/alpine-docker-python/ to understand why Alpine is such a pain to use with Python. |
The
get_info
import insetup.py
(https://github.com/statsmodels/statsmodels/blob/master/setup.py#L335) implicitly requires numpy to be installed before statsmodels.Otherwise, statsmodels installation fails:
This is especially problematic for applications that declare dependencies using a
requirements.txt
, since that file may includenumpy
, but it won't necessarily be completely installed beforestatsmodels
.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.
The text was updated successfully, but these errors were encountered: