幫我解決 mysqlclient 錯誤
P粉207483087
P粉207483087 2023-11-01 13:36:19
0
2
697


pip 安裝 mysqlclient

#
Collecting mysqlclient
  Using cached mysqlclient-2.1.1.tar.gz (88 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      /bin/sh: 1: mysql_config: not found
      /bin/sh: 1: mariadb_config: not found
      /bin/sh: 1: mysql_config: not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-k_urbzi_/mysqlclient_beba1330b6804b2990fa74f56f11c3f5/setup.py", line 15, in <module>
          metadata, options = get_config()
        File "/tmp/pip-install-k_urbzi_/mysqlclient_beba1330b6804b2990fa74f56f11c3f5/setup_posix.py", line 70, in get_config
          libs = mysql_config("libs")
        File "/tmp/pip-install-k_urbzi_/mysqlclient_beba1330b6804b2990fa74f56f11c3f5/setup_posix.py", line 31, in mysql_config
          raise OSError("{} not found".format(_mysql_config_path))
      OSError: mysql_config not found
      mysql_config --version
      mariadb_config --version
      mysql_config --libs
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

請幫我修復錯誤。

python-V

Python 3.9.2

點列表

軟體包版本


點 22.3 pkg_資源 0.0.0 安裝工具65.5.0

P粉207483087
P粉207483087

全部回覆(2)
P粉553428780

謝謝。問題已解決

Linux 請注意,這是一個基本步驟。我不支持為所有環境建立完整的步驟。如果您看到一些錯誤,您應該自行修復它,或在某些用戶論壇中尋求支援。不要在問題追蹤器上提交問題。

您可能需要安裝 Python 3 和 MySQL 開發頭檔和函式庫,如下所示:

sudo apt-get install python3-dev default-libmysqlclient-dev build-essential

Debian / Ubuntu

pip install mysqlclient
P粉116631591

您需要按照此軟體包的安裝說明進行操作。

https://pypi.org/project/mysqlclient/

聽起來您在 OSX 上 - 您需要在那裡安裝 mysql。

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板