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

Doesn't work with docker alpine image: No matching distribution found for py-spy #23

Closed
marcstreeter opened this issue Sep 7, 2018 · 6 comments

Comments

@marcstreeter
Copy link
Contributor

marcstreeter commented Sep 7, 2018

using python:3.6-alpine image (running Python 3.6.6) and getting the following behavior when attempting to install py-spy

pip install py-spy
Could not find a version that satisfies the requirement py-spy (from versions: )
No matching distribution found for py-spy
@marcstreeter marcstreeter changed the title No matching distribution found for py-spy Doesn't work with docker alpine image: No matching distribution found for py-spy Sep 7, 2018
@marcstreeter
Copy link
Contributor Author

works with regular python image, it's the alpine images it doesn't work with.

@benfred
Copy link
Owner

benfred commented Sep 8, 2018

So, alpine python opts out of the manylinux1 wheels: pypa/pip#3969 (comment) . It seems like it's because of a compatibility issue with glibc instead of musl libc that they use.

Its' possible to get py-spy to install on alpine docker linux by following the steps there

/ # echo 'manylinux1_compatible = True' > /usr/local/lib/python3.6/site-packages/_manylinux.py
/ # pip install py-spy
Collecting py-spy
  Downloading https://files.pythonhosted.org/packages/f6/bf/1c32d4690d68b5f0e388830531d385f8034d02ccf655d1cfb1cccd9494d3/py_spy-0.1.4-py2.py3-none-manylinux1_x86_64.whl (5.1MB)
    100% |████████████████████████████████| 5.2MB 4.0MB/s 
Installing collected packages: py-spy
Successfully installed py-spy-0.1.4

But it still doesn't work because of the glibc issues =(.

I'm switching over from using glibc as a dynamic lib, to using musl as a static library to get around some other issues, and I believe once that change has been made this should work.

@marcstreeter
Copy link
Contributor Author

👍

@benfred
Copy link
Owner

benfred commented Sep 10, 2018

I pushed the musl libc changes out with v0.1.5 and tested with python:3.6-alpine docker image. With setting that manylinux1 flag everything seems to work when installing from pip (alternatively you can also install using cargo).

discord:~ ben$ docker run -it --cap-add SYS_PTRACE python:3.6-alpine sh
/ # echo 'manylinux1_compatible = True' > /usr/local/lib/python3.6/site-packages/_manylinux.py
/ # pip install py-spy
Collecting py-spy
  Downloading https://files.pythonhosted.org/packages/2d/c9/ea1c28b39de630ed2292a20cab7c9af99e09bcddcda6c7e1e0753b3f59bc/py_spy-0.1.5-py2.py3-none-manylinux1_x86_64.whl (2.9MB)
    100% |████████████████████████████████| 2.9MB 5.0MB/s 
Installing collected packages: py-spy
Successfully installed py-spy-0.1.5
/ # py-spy -- python -c 'while True: print("foo")'


Collecting samples from 'python -c while True: print("foo")' (python v3.6.6)

@lawliet89
Copy link

lawliet89 commented Jan 8, 2020

Sorry to dig this old issue up. You might want to suggest to users that they rm /usr/local/lib/python3.7/site-packages/_manylinux.py after doing this. Otherwise, subsequent pip install usually end up with lots of ldd errors.

Alternatively, maybe the pip package can distribute binaries that are musl built instead (if that's not already the case).

@dHannasch
Copy link

    git clone https://github.com/benfred/py-spy.git \
    && cd py-spy \
    && pip install --editable . --verbose \
    && cd ..

seems to work as well (without messing with _manylinux.py). Hard to say which is preferable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants