install pandas and numpy for python3?
I have tried unsuccessfully to install numpy and pandas using both apk (says machine needs SSE) and pip (hangs). Has anyone found a way to install these python packages?
I had a similar issue:
apk add python3 py3-numpy
python3
>>> import numpy
would raise RuntimeError: NumPy was built with baseline optimizations: (SSE SSE2) but your machine doesn't support: (SSE).
Replacing the 3.14 repo links in /etc/apk/repositories with those from 3.13 then running apk update and reinstalling the packages solves the issue.
I’m trying this out to use the old versions without downgrading the whole system. Note that alpine is up to v3.16 now.
# add 3.13 repos, keeping 3.14
echo https://dl-cdn.alpinelinux.org/alpine/v3.13/main >> /etc/apk/repositories
echo https://dl-cdn.alpinelinux.org/alpine/v3.13/community >> /etc/apk/repositories
apk update
apk del --rdepends python3 # removes everything using python3.9
apk add python3\<3.9 py3-numpy\<1.20 py3-pip # installs python3.8
This fixes numpy, but it appears to break pip:
# pip -v Traceback (most recent call last): File "/usr/bin/pip", line 33, in <module> sys.exit(load_entry_point('pip==20.3.4', 'console_scripts', 'pip')()) File "/usr/bin/pip", line 22, in importlib_load_entry_point for entry_point in distribution(dist_name).entry_points File "/usr/lib/python3.8/importlib/metadata.py", line 503, in distribution return Distribution.from_name(distribution_name) File "/usr/lib/python3.8/importlib/metadata.py", line 177, in from_name raise PackageNotFoundError(name) importlib.metadata.PackageNotFoundError: pip
I never finished trying that workaround and it likely needs further development. Note that pip doesn’t work for me regardless, and I use easy_install instead: https://github.com/ish-app/ish/issues/1696#issuecomment-1152238005