error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 and ERROR: Failed building wheel for mysqlclient

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 and ERROR: Failed building wheel for mysqlclient

错误太多了。

  /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
  ----------------------------------------
  ERROR: Failed building wheel for mysqlclient


  code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, 
  '"'"'exec'"'"'))' install --record /tmp/pip-record-0p2809_2/install-record.txt --single- 
  version-externally-managed --compile Check the logs for full command output.

我尝试了 python-dev 也尝试了 python3-dev 。并更改了 mysqlclient 版本,但没有发生相同的 issue.these 代码在 docker 文件中。请帮忙。

根据前两行,您缺少 libssl-dev 系统包;在你的 dockerfile 中尝试 apt-get install -y libssl-dev

你还需要 libmysqlclient-dev,如果你还没有添加的话。