本地环境
电脑:Mac OS 15.0.1 (24A348)(M1芯片)
Python: Python 3.12.4
报错信息:
pip3 install mysqlclient
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting mysqlclient
Using cached https://mirrors.aliyun.com/pypi/packages/79/33/996dc0ba3f03e2399adc91a7de1f61cb14b57ebdb4cc6eca8a78723043cb/mysqlclient-2.2.4.tar.gz (90 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
解决指令:
brew install mysql-connector-c
echo 'export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/opt/homebrew/opt/mysql-client/lib"
export CPPFLAGS="-I/opt/homebrew/opt/mysql-client/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql-client/lib/pkgconfig"
source ~/.zshrc
pip3 install mysqlclient
解决时中断运行log:
Last login: Mon Oct 28 13:50:41 on ttys021
cassius ~ % which mysql_config
/usr/local/mysql-9.1.0-macos14-arm64/bin/mysql_config
cassius ~ % brew install mysql-connector-c
==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################### 100.0%
Warning: Formula mysql-connector-c was renamed to mysql-client.
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/mysql-client/manifests/9.0.1
######################################################################### 100.0%
==> Fetching dependencies for mysql-client: libevent, libcbor, libfido2, zlib, lz4, xz and zstd
==> Downloading https://ghcr.io/v2/homebrew/core/libevent/manifests/2.1.12_1
######################################################################### 100.0%
==> Fetching libevent
==> Downloading https://ghcr.io/v2/homebrew/core/libevent/blobs/sha256:65fc7c61f
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libcbor/manifests/0.11.0
######################################################################### 100.0%
==> Fetching libcbor
==> Downloading https://ghcr.io/v2/homebrew/core/libcbor/blobs/sha256:1316d2dd79
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libfido2/manifests/1.15.0
######################################################################### 100.0%
==> Fetching libfido2
==> Downloading https://ghcr.io/v2/homebrew/core/libfido2/blobs/sha256:b07f0c07f
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/zlib/manifests/1.3.1
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/f68d0caf232d52f2aa586abefbbfd7e958e384d84f3967008fa83de94b5f10ae--zlib-1.3.1.bottle_manifest.json
==> Fetching zlib
==> Downloading https://ghcr.io/v2/homebrew/core/zlib/blobs/sha256:a801a93f88dba
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/e9447ccbb4ebbb5283c26da53ead70a7aa642d3f4bffb9f6cffa4a7be3e4260b--zlib--1.3.1.arm64_sequoia.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/lz4/manifests/1.10.0-1
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/8e11e90eb21a06e0f199af9d80e011e3693c77dd353b2477579d95c8471a5802--lz4-1.10.0-1.bottle_manifest.json
==> Fetching lz4
==> Downloading https://ghcr.io/v2/homebrew/core/lz4/blobs/sha256:5bd143b7b78498
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/8af6cbc3dc870dba18d9a1b3f311f2d43b56a020a1e565289122cfda703ab791--lz4--1.10.0.arm64_sequoia.bottle.1.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/xz/manifests/5.6.3
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/e68799185cc17334108ba286ba8c3df0587c9fd8375647d85f7157b62a797599--xz-5.6.3.bottle_manifest.json
==> Fetching xz
==> Downloading https://ghcr.io/v2/homebrew/core/xz/blobs/sha256:743c3d366f11b13
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/c95c353632e7ddcee827729e0337302aeb5369065de8904f6cde5d3cc6b23e8d--xz--5.6.3.arm64_sequoia.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/zstd/manifests/1.5.6
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/29403e0df5404d8aeca0e750ac135ec9ef44fc5eeb6df69170ed602acabf0ffb--zstd-1.5.6.bottle_manifest.json
==> Fetching zstd
==> Downloading https://ghcr.io/v2/homebrew/core/zstd/blobs/sha256:487f35700f563
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/bcdf6b56ea7b8b23105f1518ddd0830ac5a56c333b0274959c10084ea3a31346--zstd--1.5.6.arm64_sequoia.bottle.tar.gz
==> Fetching mysql-client
==> Downloading https://ghcr.io/v2/homebrew/core/mysql-client/blobs/sha256:b1476
######################################################################### 100.0%
==> Installing dependencies for mysql-client: libevent, libcbor, libfido2, zlib, lz4, xz and zstd
==> Installing mysql-client dependency: libevent
==> Downloading https://ghcr.io/v2/homebrew/core/libevent/manifests/2.1.12_1
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/68b113f9ab63db45f4e1860de522ce2ca4fa081eb3c0d5c7d6005a35c3cf8d06--libevent-2.1.12_1.bottle_manifest.json
==> Pouring libevent--2.1.12_1.arm64_sequoia.bottle.tar.gz
🍺 /opt/homebrew/Cellar/libevent/2.1.12_1: 58 files, 2.2MB
==> Installing mysql-client dependency: libcbor
==> Downloading https://ghcr.io/v2/homebrew/core/libcbor/manifests/0.11.0
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/547a8f3a73e95b1a6ae76032004f514d926b4dbe82bab530cb3dd011c85c23ed--libcbor-0.11.0.bottle_manifest.json
==> Pouring libcbor--0.11.0.arm64_sequoia.bottle.tar.gz
🍺 /opt/homebrew/Cellar/libcbor/0.11.0: 34 files, 201.9KB
==> Installing mysql-client dependency: libfido2
==> Downloading https://ghcr.io/v2/homebrew/core/libfido2/manifests/1.15.0
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/292955ce6f66d4d7d827690a78eeac2946aab6468af64c128d6083ee8658337d--libfido2-1.15.0.bottle_manifest.json
==> Pouring libfido2--1.15.0.arm64_sequoia.bottle.tar.gz
🍺 /opt/homebrew/Cellar/libfido2/1.15.0: 562 files, 1.3MB
==> Installing mysql-client dependency: zlib
==> Downloading https://ghcr.io/v2/homebrew/core/zlib/manifests/1.3.1
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/f68d0caf232d52f2aa586abefbbfd7e958e384d84f3967008fa83de94b5f10ae--zlib-1.3.1.bottle_manifest.json
==> Pouring zlib--1.3.1.arm64_sequoia.bottle.tar.gz
🍺 /opt/homebrew/Cellar/zlib/1.3.1: 14 files, 403.9KB
==> Installing mysql-client dependency: lz4
==> Downloading https://ghcr.io/v2/homebrew/core/lz4/manifests/1.10.0-1
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/8e11e90eb21a06e0f199af9d80e011e3693c77dd353b2477579d95c8471a5802--lz4-1.10.0-1.bottle_manifest.json
==> Pouring lz4--1.10.0.arm64_sequoia.bottle.1.tar.gz
🍺 /opt/homebrew/Cellar/lz4/1.10.0: 24 files, 713.6KB
==> Installing mysql-client dependency: xz
==> Downloading https://ghcr.io/v2/homebrew/core/xz/manifests/5.6.3
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/e68799185cc17334108ba286ba8c3df0587c9fd8375647d85f7157b62a797599--xz-5.6.3.bottle_manifest.json
==> Pouring xz--5.6.3.arm64_sequoia.bottle.tar.gz
🍺 /opt/homebrew/Cellar/xz/5.6.3: 96 files, 2.0MB
==> Installing mysql-client dependency: zstd
==> Downloading https://ghcr.io/v2/homebrew/core/zstd/manifests/1.5.6
Already downloaded: /Users/cassius.huang/Library/Caches/Homebrew/downloads/29403e0df5404d8aeca0e750ac135ec9ef44fc5eeb6df69170ed602acabf0ffb--zstd-1.5.6.bottle_manifest.json
==> Pouring zstd--1.5.6.arm64_sequoia.bottle.tar.gz
🍺 /opt/homebrew/Cellar/zstd/1.5.6: 32 files, 2.1MB
==> Installing mysql-client
==> Pouring mysql-client--9.0.1.arm64_sequoia.bottle.tar.gz
==> Caveats
mysql-client is keg-only, which means it was not symlinked into /opt/homebrew,
because it conflicts with mysql (which contains client libraries).
If you need to have mysql-client first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
For compilers to find mysql-client you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/mysql-client/lib"
export CPPFLAGS="-I/opt/homebrew/opt/mysql-client/include"
For pkg-config to find mysql-client you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql-client/lib/pkgconfig"
==> Summary
🍺 /opt/homebrew/Cellar/mysql-client/9.0.1: 120 files, 125.7MB
==> Running `brew cleanup mysql-client`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> mysql-client
mysql-client is keg-only, which means it was not symlinked into /opt/homebrew,
because it conflicts with mysql (which contains client libraries).
If you need to have mysql-client first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
For compilers to find mysql-client you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/mysql-client/lib"
export CPPFLAGS="-I/opt/homebrew/opt/mysql-client/include"
For pkg-config to find mysql-client you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql-client/lib/pkgconfig"
cassius ~ % echo 'export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
cassius ~ % export LDFLAGS="-L/opt/homebrew/opt/mysql-client/lib"
cassius ~ % export CPPFLAGS="-I/opt/homebrew/opt/mysql-client/include"
cassius ~ % export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql-client/lib/pkgconfig"
cassius ~ % source ~/.zshrc
cassius ~ % pip3 install mysqlclient
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting mysqlclient
Using cached https://mirrors.aliyun.com/pypi/packages/be/95/1af2ee813d4f0b607082c18bb82aa05c98a95a402a1d2d5808999317cb16/mysqlclient-2.2.5.tar.gz (90 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (pyproject.toml) ... done
Created wheel for mysqlclient: filename=mysqlclient-2.2.5-cp312-cp312-macosx_10_9_universal2.whl size=97163 sha256=0b876e06727cb49148a1ce67673659d385ece3d2fe8c430caf2bddc8bfd334bd
Stored in directory: /Users/cassius.huang/Library/Caches/pip/wheels/09/bb/ac/3676d8e8c4ca055ac13dba68fe7aa70946cd9ea46d79ad5d19
Successfully built mysqlclient
Installing collected packages: mysqlclient
Successfully installed mysqlclient-2.2.5
cassius ~ %

6979

被折叠的 条评论
为什么被折叠?



