python --enable-shared

https://github.com/docker-library/python/issues/21

例如编译安装python3.5.2,脚本如下:

wget https://s3.cn-north-1.amazonaws.com.cn/zeusis/packages/Python-3.5.2.tgz
tar -xf Python-3.5.2.tgz
cd Python-3.5.2
./configure --prefix=/usr/local --enable-shared
make
make install

 

其中 ./configure --prefix=/usr/local --enable-shared  中的 --enable-shared 很重要。

启用共享,方便其他依赖python的一些内置库(比如 mysqlclient) 的资源的正常安装; 不启用可能报以下错误:

...
command 'gcc' failed with exit status 1

 

When running configure, you should be supplying the --enable-shared option to ensure that shared libraries are built for Python. By not doing this you are preventing any application which wants to use Python as an embedded environment from working. This is because the lack of the shared library results in any embedded system failing at compile time with:

...
error: command 'gcc' failed with exit status 1

 

ps:

ldconfig可用于解决python运行时so库找不到的问题。

转载于:https://www.cnblogs.com/Tommy-Yu/p/6144512.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值