Closed SerhiyRomanov closed 11 months ago
We've never published PyYAML wheels for Alpine, which means the native code extension build that's failing occurred in your environment upon installation. 6.0.1 and 6.0 are literally exactly the same code (there was just a packaging metadata hint added to block usage of the newest incompatible versions of Cython). It's likely something has changed in your environment since your local 6.0 wheel was built (dev tools, headers, libraries, or the way it was installed).
There's not really anything we can do to help you debug that problem, since the same code (6.0) was clearly already working in your environment. Further, AFAICT, Python 3.7 isn't even packaged for Alpine 3.14, so maybe you built your own?
In any case, it appears you may have a number of complexities in your environment that could be breaking things, but I had no trouble just now building PyYAML with the native libyaml extension using the Alpine-3.14 packaged Python 3.9 and passing its full test suite successfully using the following in a vanilla Alpine 3.14 container:
[mdavis@mdavis-p1 ~]$ podman run -it alpine:3.14 ash
/ # apk add git python3-dev yaml-dev musl-dev gcc && \
git clone https://github.com/yaml/pyyaml && \
python3 -m ensurepip && \
PYYAML_FORCE_CYTHON=1 PYYAML_FORCE_LIBYAML=1 python3 -m pip install pyyaml -v && \
cd pyyaml && \
python3 tests/lib/test_all.py
(output elided)
Successfully installed pyyaml-6.0.1
(output elided)
===========================================================================
TESTS: 2609
You should be able to alter what I did there to use the Python 3.7 you've got installed and replicate the same process. If you're unable, I'd suggest maybe trying without the libyaml extension (eg PYYAML_FORCE_CYTHON=0 PYYAML_FORCE_LIBYAML=0 python3 -m pip install --no-cache pyyaml==6.0.1
), since build problems there are almost certainly what's causing the segfault.
In any case, I'm going to close this issue, as it's almost certainly an environment-specific configuration problem- hopefully the info provided can help you back to a working installation of PyYAML.
We use that package together with Flask and run inside Docker container with UWSGI.
I see normal startup in the logs
which fails with
!!! uWSGI process 12 got Segmentation Fault !!!
once we reach the code which tries toimport yaml
We cannot see a detailed backtrace because of that limitation. Version 6.0 works without problems