0

I am trying install mysqlclient-python in docker with Debian 8
but when I run 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..
Do you know what exactly I need?

7
  • To solve that error, try $ sudo apt-get install python3-dev or $ sudo apt-get install python3.4-dev. Commented Mar 24, 2017 at 15:30
  • this packages I have installed but don't works Commented Mar 24, 2017 at 15:32
  • What was the procedure you followed? Commented Mar 24, 2017 at 15:35
  • Or did you try to pip install? Commented Mar 24, 2017 at 15:37
  • I runned your commands and then: pip3 install mysqlclient in docker. If you want, I can send you my Dockerfile and docker's bash_history Commented Mar 24, 2017 at 15:41

1 Answer 1

3

If -lssl and -lcrypto are failing, you're likely missing the libssl headers

On debian-based systems you can install these with

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.