简体   繁体   English

在Docker中安装mysqlclient-python

[英]Install mysqlclient-python in Docker

I am trying install mysqlclient-python in docker with Debian 8 我正在尝试使用Debian 8在docker中安装mysqlclient-python
but when I run python3 setup.py install 但是当我运行python3 setup.py install
I get error: 我得到错误:

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/_mysql.o -lmysqlclient -lpthread -lz -lm -ldl -lssl -lcrypto -o build/lib.linux-x86_64-3.4/_mysql.cpython-34m.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I tryed install various packages (openssl, crypto++, libmysqlclient-dev, mysql-client,...) but nothing helped me.. 我尝试安装各种软件包(openssl,crypto ++,libmysqlclient-dev,mysql-client等),但没有任何帮助。
Do you know what exactly I need? 你知道我到底需要什么吗?

If -lssl and -lcrypto are failing, you're likely missing the libssl headers 如果-lssl-lcrypto失败,则可能丢失了libssl标头

On debian-based systems you can install these with 在基于debian的系统上,您可以使用

apt-get install libssl-dev

Most likely you'll already have an apt line in your Dockerfile which installs libmysqlclient-dev , you'll simply add libssl-dev to the list of packages there. 最有可能的是,您的Dockerfile已经有一条apt行,用于安装libmysqlclient-dev ,您只需将libssl-dev添加到那里的软件包列表中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM