Alpine安装Python3依赖出现的问题及解决
apk换源sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories安装Python的构建环境apk add --no-cache --virtual build-dependencies \python3-dev \libffi-dev \openssl-dev \gcc \libc-dev \make
·
apk换源
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
安装Python的构建环境
apk add --no-cache --virtual build-dependencies \
python3-dev \
libffi-dev \
openssl-dev \
gcc \
libc-dev \
make
安装Python依赖包
ImportError: cannot import name 'Feature' from 'setuptools'
pip install --upgrade pip setuptools==45.2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
ModuleNotFoundError: No module named 'Cython'
pip install cython -i https://pypi.tuna.tsinghua.edu.cn/simple
pymssql安装不上
command 'gcc' failed with exit status 1
后面发现是漏装了一个环境freetds-dev
重新安装之后,就能成功安装依赖了
apk add freetds-dev
注意的是,依赖成功安装之后,如果为了docker镜像大小,卸载了freetds-dev
这个环境包,会导致访问数据库的时候报错libsybdb.so.5: cannot open shared object file: No such file or directory
grpcio安装不上
和上面一样,漏了环境build-base linux-headers
执行apk add build-base linux-headers
之后,就能成功安装
Pillow安装不上
和上面一样,漏了环境jpeg-dev zlib-dev
执行apk add jpeg-dev zlib-dev
之后,就能成功安装
最后卸载依赖
apk del build-dependencies
更多推荐
已为社区贡献1条内容
所有评论(0)