Skip to content
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

Pandas fails to install on latest pre-release candidate #5171

Closed
davidjlloyd opened this issue Apr 5, 2018 · 17 comments
Closed

Pandas fails to install on latest pre-release candidate #5171

davidjlloyd opened this issue Apr 5, 2018 · 17 comments
Labels
auto-locked Outdated issues that have been locked by automation type: support User Support

Comments

@davidjlloyd
Copy link

davidjlloyd commented Apr 5, 2018

  • Pip version: 10.0.0b2
  • Python version: PyPy 5.10.0 with GCC 6.2.0
  • Operating system: Ubuntu 16.04

Description:

We are creating a new virtualenv using PyPy and then attempting to install the package 'pandas'. Everything is running inside a clean Docker container. This bug does not occur with the same conditions and Pip 9.0.3. We are using a DevPI server to host our own packages, which mirrors content from PyPI. This does not appear to be an issue with Cython being available, as I can install it directly.

What I've run:

root@9b34418ce20d:/# /opt/pypy/bin/pypy /usr/lib/python2.7/dist-packages/virtualenv.py -p /opt/pypy/bin/pypy /opt/pypyenv
Already using interpreter /opt/pypy/bin/pypy
New pypy executable in /opt/pypyenv/bin/pypy
Installing setuptools, pkg_resources, pip, wheel...done.
root@9b34418ce20d:/# /opt/pypyenv/bin/pip freeze --all
cffi==1.11.2
greenlet==0.4.12
pip==10.0.0b2
pkg-resources==0.0.0
readline==6.2.4.1
setuptools==39.0.1
wheel==0.31.0

root@9b34418ce20d:/# /opt/pypyenv/bin/pip install pandas
Looking in indexes: https://devpi.myindex/root/myindex/+simple/
Collecting pandas
  Downloading https://devpi.myindex/root/pypi/+f/c7a/2757b60774825/pandas-0.22.0.tar.gz (11.3MB)
    100% |################################| 11.3MB 1.5MB/s 
  Could not find a version that satisfies the requirement Cython (from versions: )
No matching distribution found for Cython

root@9b34418ce20d:/# /opt/pypyenv/bin/pip install cython
Looking in indexes: https://devpi.myindex/root/myindex/+simple/
Collecting cython
  Downloading https://devpi.myindex/root/pypi/+f/c54/9effadb52d90b/Cython-0.28.1.tar.gz (1.8MB)
    100% |################################| 1.8MB 2.8MB/s 
Building wheels for collected packages: cython
  Running setup.py bdist_wheel for cython ... done
  Stored in directory: /root/.cache/pip/wheels/8e/21/58/4a0b5de660445a5a2c957575e2de6c2465df8c7c8310ae2e42
Successfully built cython
Installing collected packages: cython
  The scripts cygdb, cython and cythonize are installed in '/opt/pypyenv/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed cython-0.28.1
@benoit-pierre
Copy link
Member

Does it work if you try: /opt/pypyenv/bin/pip install Cython (with a capital C)? Does it work if you don't use your own index?

@benoit-pierre
Copy link
Member

Also, what is the output of /opt/pypyenv/bin/pip install -vv pandas?

@pradyunsg pradyunsg added the S: awaiting response Waiting for a response/more information label Apr 7, 2018
@pradyunsg
Copy link
Member

Ping @davidjlloyd!

@jfloff
Copy link

jfloff commented Apr 8, 2018

I am also experiencing the same problem. I'm within a Docker container (Alpine) and don't have the /opt/pypyenv/bin/pip executable.

@pradyunsg pradyunsg removed the S: awaiting response Waiting for a response/more information label Apr 8, 2018
@davidjlloyd
Copy link
Author

I've recreated an almost minimal example for people to play with in Docker:

FROM ubuntu:16.04

RUN apt-get update && apt-get install -y bzip2 curl python-virtualenv
RUN curl -sS -L https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.10.0-linux64.tar.bz2 | tar -C /opt -xjpf - && ln -s pypy2-v5.10.0-linux64 /opt/pypy
RUN virtualenv -p /opt/pypy/bin/pypy /opt/pypyenv
RUN /opt/pypyenv/bin/pip install pandas

This gives the reported output. You could probably recreate using CPython and installing Pandas using source distributions, but that currently hits another error first.

@pfmoore
Copy link
Member

pfmoore commented Apr 10, 2018

@davidjlloyd please can you provide the output with -vv as that should show what candidates were tried and discarded.

@davidjlloyd
Copy link
Author

Here's the full output from building that Dockerfile with the additional -vv option for pip: output.txt

@pfmoore
Copy link
Member

pfmoore commented Apr 11, 2018

The key in there is probably "No sources permitted for Cython". I don't know why that's happening - is there some configuration (either in your setup or in Pandas) that would stop pip from installing Cython from source?

@pfmoore
Copy link
Member

pfmoore commented Apr 11, 2018

Pandas has Cython as a build requirement in its pyproject.toml. However, pip 10 requires that all build dependencies are available in binary form - this is a limitation of our initial PEP 518 support, documented here.

Until pip adds support for building build dependencies from source, you'll need to install Cython manually in your build environment (which will involve using the --no-build-isolation flag.

@davidjlloyd
Copy link
Author

Whilst build isolation seems like a valuable feature, the fact that it requires binary distributions for all dependencies makes the default behaviour of enabling it a significant breaking change over Pip v9.0.3. It is especially bad for variant Python implementations like PyPy, which typically don't have any wheels available to them. Is there a strong reason to not default the behaviour to --no-build-isolation instead, at least until we can install build dependencies from source?

@davidjlloyd
Copy link
Author

Running my example with the --no-build-isolation flag also fails with a different error: output.txt

Unfortunately this means I cannot verify that it works if we don't have build isolation enabled.

@pfmoore
Copy link
Member

pfmoore commented Apr 11, 2018

Your new error doesn't seem to be related to pip - "cc not found" looks more like a problem with your environment.

It's not build isolation that requires binary dependencies, it's pp's current implementation of PEP 518 support (pyproject.toml). And while pip's support for PEP 518 is incomplete at the moment, we've not made any secret of that fact. In the absence of any full implementations of PEP 518, it's arguable that Pandas' adoption of it for specifying a dependency like Cython which needs platform-specific wheels was premature.

@davidjlloyd
Copy link
Author

Your new error doesn't seem to be related to pip - "cc not found" looks more like a problem with your environment.

Yup, that was my mistake. I was trying to put up any information I could in a hurry before leaving last night. After installing a few more dependencies it works fine, so at least we have a simple fix after Pip 10 is released.

I'll report this issue against Pandas as well in case they want to address it, but it sounds like we're just going to have to accept this Pip upgrade will have teething problems and deal with them when they happen. Obviously the ideal for us would be support for source distributions as part of the PEP 518 implementation in Pip, but I'm not holding my breath for this to happen in time for the next major release.

@cdagraca
Copy link

We are experiencing this on pip v10.0.0. We've had to pin to 9.x for docker containers using pandas for the time being as the builds suddenly broke over the weekend with the release.

@Davidnet
Copy link

Davidnet commented Apr 20, 2018

I'm also encountering this error, I usually work with embedded devices, and providing binaries is not a plausible option. There should be a flag to pip to behave like pip 9

@pradyunsg
Copy link
Member

@Davidnet --no-build-isolation

@pradyunsg pradyunsg added the type: support User Support label May 10, 2018
@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: support User Support
Projects
None yet
Development

No branches or pull requests

7 participants