gpt4 book ai didi

mysql - 错误:mysqlclient的构建轮失败

转载 作者:行者123 更新时间:2023-11-30 21:30:11 25 4
gpt4 key购买 nike

我无法'pip install mysqlclient',并且每次尝试都返回错误:'ERROR:mysqlclient的构建轮失败'。就上下文而言,我在macOS Mojave 10.14.5上运行。本文的其余部分假定已经下载了“ python == 3.6”和“ virtualenv”。另外,已经安装了x代码命令行工具(并不是我认为那很重要)。

为此(从命令行):


'virtualenv〜/ venv'


输出:


使用基本前缀'/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6'
/Users/usr1/venv/bin/python3.6中的新python可执行文件
还可以在/ Users / usr1 / venv / bin / python中创建可执行文件
安装setuptools,pip,wheel ...完成。”
'来源〜/ venv / bin / activate'
'pip安装mysqlclient'


到目前为止,我已经查看并尝试了所有方法:


Failed building wheel for mysqlclient
"Failed building wheel for psycopg2" - MacOSX using virtualenv and pip
Failed building wheel for mysql-python

收集mysqlclient
  使用缓存的https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
收集包的构建轮:mysqlclient
  mysqlclient(setup.py)的构建轮...错误
  错误:命令/Users/usr1/venv/bin/python3.6 -u -c'import setuptools,tokenize; file ='“'”'/ private / var / folders / 2j / 1qt0_7q96lxbxl2w5kx8r1zr0000gn / T / pip- install-4uobjq_4 / mysqlclient / setup.py'“'”'; f = getattr(tokenize,'“'”'open'“'”',open)(文件); code = f.read()。replace(' “'”'\ r \ n'“'”','“'”'\ n'“'”'); f.close(); exec(compile(code,file,'“'”'exec'“ '“))'bdist_wheel -d / private / var / folders / 2j / 1qt0_7q96lxbxl2w5kx8r1zr0000gn / T / pip-wheel-ehvuw9uv --python-tag cp36:
  错误:正在运行bdist_wheel
  运行构建
  运行build_py
  创建版本
  创建build / lib.macosx-10.13-x86_64-3.6
  创建build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
  复制MySQLdb / init.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
  复制MySQLdb / _exceptions.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
  复制MySQLdb / compat.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
  复制MySQLdb / connections.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
  复制MySQLdb / converters.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
  复制MySQLdb / cursors.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
  复制MySQLdb / release.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
  复制MySQLdb / times.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
  创建build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
  复制MySQLdb / constants / init.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
  复制MySQLdb / constants / CLIENT.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
  复制MySQLdb / constants / CR.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
  复制MySQLdb / constants / ER.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
  复制MySQLdb / constants / FIELD_TYPE.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
  复制MySQLdb / constants / FLAG.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
  运行build_ext
  构建'MySQLdb._mysql'扩展
  创建build / temp.macosx-10.13-x86_64-3.6
  创建build / temp.macosx-10.13-x86_64-3.6 / MySQLdb
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info =(1,4,2,'post',1 )-D__version __ = 1.4.2.post1 -I / usr / local / Cellar / mysql / 5.7.19 / include / mysql -I / usr / local / Cellar / python / 3.6.5_1 / Frameworks / Python.framework / Versions / 3.6 / include / python3.6m -c MySQLdb / _mysql.c -o build / temp.macosx-10.13-x86_64-3.6 / MySQLdb / _mysql.o
  铛-bundle-未定义dynamic_lookup build / temp.macosx-10.13-x86_64-3.6 / MySQLdb / _mysql.o -L / usr / local / Cellar / mysql / 5.7.19 / lib -lmysqlclient -lssl -lcrypto -o build / lib .macosx-10.13-x86_64-3.6 / MySQLdb / _mysql.cpython-36m-darwin.so
  ld:找不到用于-lssl的库
  clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
  错误:命令“ clang”失败,退出状态为1



错误:mysqlclient的构建轮失败
  为mysqlclient运行setup.py clean
无法建立mysqlclient
安装收集的软件包:mysqlclient
  正在运行mysqlclient的setup.py install ...错误
    错误:命令/Users/usr1/venv/bin/python3.6 -u -c'import setuptools,tokenize; file ='“'”'/ private / var / folders / 2j / 1qt0_7q96lxbxl2w5kx8r1zr0000gn / T / pip- install-4uobjq_4 / mysqlclient / setup.py'“'”'; f = getattr(tokenize,'“'”'open'“'”',open)(文件); code = f.read()。replace(' “'”'\ r \ n'“'”','“'”'\ n'“'”'); f.close(); exec(compile(code,file,'“'”'exec'“ '“'))'install --record /private/var/folders/2j/1qt0_7q96lxbxl2w5kx8r1zr0000gn/T/pip-record-zvd4oedq/install-record.txt --single-version-externally-managed --compile --install-标头/Users/usr1/venv/bin/../include/site/python3.6/mysqlclient:
    错误:正在运行安装
    运行构建
    运行build_py
    创建版本
    创建build / lib.macosx-10.13-x86_64-3.6
    创建build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
    复制MySQLdb / init.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
    复制MySQLdb / _exceptions.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
    复制MySQLdb / compat.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
    复制MySQLdb / connections.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
    复制MySQLdb / converters.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
    复制MySQLdb / cursors.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
    复制MySQLdb / release.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
    复制MySQLdb / times.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb
    创建build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
    复制MySQLdb / constants / init.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
    复制MySQLdb / constants / CLIENT.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
    复制MySQLdb / constants / CR.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
    复制MySQLdb / constants / ER.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
    复制MySQLdb / constants / FIELD_TYPE.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
    复制MySQLdb / constants / FLAG.py-> build / lib.macosx-10.13-x86_64-3.6 / MySQLdb / constants
    运行build_ext
    构建'MySQLdb._mysql'扩展
    创建build / temp.macosx-10.13-x86_64-3.6
    创建build / temp.macosx-10.13-x86_64-3.6 / MySQLdb
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info =(1,4,2,'post',1 )-D__version __ = 1.4.2.post1 -I / usr / local / Cellar / mysql / 5.7.19 / include / mysql -I / usr / local / Cellar / python / 3.6.5_1 / Frameworks / Python.framework / Versions / 3.6 / include / python3.6m -c MySQLdb / _mysql.c -o build / temp.macosx-10.13-x86_64-3.6 / MySQLdb / _mysql.o
    铛-bundle-未定义dynamic_lookup build / temp.macosx-10.13-x86_64-3.6 / MySQLdb / _mysql.o -L / usr / local / Cellar / mysql / 5.7.19 / lib -lmysqlclient -lssl -lcrypto -o build / lib .macosx-10.13-x86_64-3.6 / MySQLdb / _mysql.cpython-36m-darwin.so
    ld:找不到用于-lssl的库
    clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
    错误:命令“ clang”失败,退出状态为1
    ----------------------------------------
错误:命令“ /Users/usr1/venv/bin/python3.6 -u -c'import setuptools,tokenize; file ='”'“'/ private / var / folders / 2j / 1qt0_7q96lxbxl2w5kx8r1zr0000gn / T / pip-install- 4uobjq_4 / mysqlclient / setup.py'“'”'; f = getattr(tokenize,'“'”'open'“'”',open)(文件); code = f.read()。replace('“'' “'\ r \ n'”'“','”'“'\ n'”'“'); f.close(); exec(compile(code,file,'”'“'exec'”'“” '))'install --record /private/var/folders/2j/1qt0_7q96lxbxl2w5kx8r1zr0000gn/T/pip-record-zvd4oedq/install-record.txt --single-version-externally-managed --compile --install-headers / Users / usr1 / venv / bin /../ include / site / python3.6 / mysqlclient“失败,错误代码为/ private / var / folders / 2j / 1qt0_7q96lxbxl2w5kx8r1zr0000gn / T / pip-install-4uobjq_4 / mysqlclient /


结论:理想情况下,我希望'pip'可以简单地安装'mysqlclient'。我非常感谢您的帮助。提前致谢。

最佳答案

从这里下载mysqlclient.whl
Python Extension Package for Windows并使用pip install mysqlclient‑1.4.2‑cp36‑cp36m‑win_amd64.whl安装

关于mysql - 错误:mysqlclient的构建轮失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56692800/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com