当前位置: 首页 > news >正文

MacOS解决安装pycurl的问题 no such file or directory: ‘/usr/lib/libcurl.@libext@‘

背景

  • 芯片:MacBook Pro M3
  • Mac OS: 14.1
  • Python 2.7
  • pip==20.3.4

执行pip install pycurl==7.19.0总是报错,例如:

Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting pycurl==7.19.0Downloading http://mirrors.aliyun.com/pypi/packages/11/73/abcfbbb6e1dd7087fa53042c301c056c11264e8a737a4688f834162d731e/pycurl-7.19.0.tar.gz (70 kB)|████████████████████████████████| 70 kB 622 kB/s
Building wheels for collected packages: pycurlBuilding wheel for pycurl (setup.py) ... errorERROR: Command errored out with exit status 1:command: /Users/skyler/Documents/py-env/venv2.7/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-vkv4WA/pycurl/setup.py'"'"'; __file__='"'"'/private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-vkv4WA/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-wheel-s5C8B2cwd: /private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-vkv4WA/pycurl/Complete output (25 lines):Using curl-config (libcurl 8.1.2)running bdist_wheelrunning buildrunning build_pycreating buildcreating build/lib.macosx-10.9-x86_64-2.7creating build/lib.macosx-10.9-x86_64-2.7/curlcopying python/curl/__init__.py -> build/lib.macosx-10.9-x86_64-2.7/curlrunning build_extbuilding 'pycurl' extensioncreating build/temp.macosx-10.9-x86_64-2.7creating build/temp.macosx-10.9-x86_64-2.7/srcgcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CURL_SSL=1 -I/Users/skyler/Documents/py-env/venv2.7/include/python2.7 -c src/pycurl.c -o build/temp.macosx-10.9-x86_64-2.7/src/pycurl.osrc/pycurl.c:85:4: warning: "libcurl was compiled with SSL support, but configure could not determine which "    "library was used; thus no SSL crypto locking callbacks will be set, which may "    "cause random crashes on SSL requests" [-W#warnings]#  warning \^src/pycurl.c:2351:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]int ret;^2 warnings generated.gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-2.7/src/pycurl.o -lcurl -o build/lib.macosx-10.9-x86_64-2.7/pycurl.so /usr/lib/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@clang: error: no such file or directory: '/usr/lib/libcurl.@libext@'clang: error: no such file or directory: '@LDFLAGS@'clang: error: no such file or directory: '@LIBCURL_LIBS@'error: command 'gcc' failed with exit status 1----------------------------------------ERROR: Failed building wheel for pycurlRunning setup.py clean for pycurl
Failed to build pycurl
Installing collected packages: pycurlRunning setup.py install for pycurl ... errorERROR: Command errored out with exit status 1:command: /Users/skyler/Documents/py-env/venv2.7/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-vkv4WA/pycurl/setup.py'"'"'; __file__='"'"'/private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-vkv4WA/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-record-x0_TkQ/install-record.txt --single-version-externally-managed --compile --install-headers /Users/skyler/Documents/py-env/venv2.7/include/site/python2.7/pycurlcwd: /private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-vkv4WA/pycurl/Complete output (25 lines):Using curl-config (libcurl 8.1.2)running installrunning buildrunning build_pycreating buildcreating build/lib.macosx-10.9-x86_64-2.7creating build/lib.macosx-10.9-x86_64-2.7/curlcopying python/curl/__init__.py -> build/lib.macosx-10.9-x86_64-2.7/curlrunning build_extbuilding 'pycurl' extensioncreating build/temp.macosx-10.9-x86_64-2.7creating build/temp.macosx-10.9-x86_64-2.7/srcgcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_CURL_SSL=1 -I/Users/skyler/Documents/py-env/venv2.7/include/python2.7 -c src/pycurl.c -o build/temp.macosx-10.9-x86_64-2.7/src/pycurl.osrc/pycurl.c:85:4: warning: "libcurl was compiled with SSL support, but configure could not determine which "    "library was used; thus no SSL crypto locking callbacks will be set, which may "    "cause random crashes on SSL requests" [-W#warnings]#  warning \^src/pycurl.c:2351:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]int ret;^2 warnings generated.gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-2.7/src/pycurl.o -lcurl -o build/lib.macosx-10.9-x86_64-2.7/pycurl.so /usr/lib/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@clang: error: no such file or directory: '/usr/lib/libcurl.@libext@'clang: error: no such file or directory: '@LDFLAGS@'clang: error: no such file or directory: '@LIBCURL_LIBS@'error: command 'gcc' failed with exit status 1----------------------------------------
ERROR: Command errored out with exit status 1: /Users/skyler/Documents/py-env/venv2.7/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-vkv4WA/pycurl/setup.py'"'"'; __file__='"'"'/private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-vkv4WA/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-record-x0_TkQ/install-record.txt --single-version-externally-managed --compile --install-headers /Users/skyler/Documents/py-env/venv2.7/include/site/python2.7/pycurl Check the logs for full command output.

解决方法

执行 brew install curl 。 老版本可以安装curl-openssl (Formula curl-openssl was renamed to curl.)

export PATH="$(brew --prefix curl)/bin:$PATH"
export LDFLAGS="-L$(brew --prefix curl)/lib"
export CPPFLAGS="-I$(brew --prefix curl)/include"

这样之后可以安装成功

pip install --no-cache-dir pycurl==7.19.0Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting pycurl==7.19.0Downloading http://mirrors.aliyun.com/pypi/packages/11/73/abcfbbb6e1dd7087fa53042c301c056c11264e8a737a4688f834162d731e/pycurl-7.19.0.tar.gz (70 kB)|████████████████████████████████| 70 kB 391 kB/s
Building wheels for collected packages: pycurlBuilding wheel for pycurl (setup.py) ... doneCreated wheel for pycurl: filename=pycurl-7.19.0-cp27-cp27m-macosx_10_9_x86_64.whl size=109152 sha256=4f3f73b5d53af44bd81bcb1819b1f2bc7154807de263146c5ac4cf249a81395fStored in directory: /private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-ephem-wheel-cache-zNstBM/wheels/10/09/3a/dec6320ee0fa59e8ecb83edf2b5fba673031c6ec2df31e7344
Successfully built pycurl
Installing collected packages: pycurl
Successfully installed pycurl-7.19.0

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 基于DPU与SmartNic的云原生SDN解决方案
  • springboot 之 使用easyexcel导出数据到多个sheet,动态表头,自动计算列宽
  • Docker核心技术:Docker原理之Cgroups
  • 全年销售7亿块,巧克力企业如何通过相邻业务打造极致产品力?
  • LCD 横屏切换为竖屏-I.MX6U嵌入式Linux C应用编程学习笔记基于正点原子阿尔法开发板
  • 初阶数据结构之栈和队列
  • huawei 路由 RIP 协议中三种定时器的工作原理
  • 快手可灵视频生成大模型全方位测评
  • CrowdStrike更新致850万Windows设备宕机,微软紧急救火!
  • JAVA学习笔记
  • QT--进程
  • qt初入门9:qt记录日志的方式,日志库了解练习(qInstallMessageHandler,qslog, log4qt)
  • 【Python】文本对齐方式
  • 大模型技术:发展历程、经典模型、微调与应用[更新中...]
  • Kafka之存储设计
  • angular2 简述
  • Codepen 每日精选(2018-3-25)
  • passportjs 源码分析
  • SpringBoot 实战 (三) | 配置文件详解
  • 从零搭建Koa2 Server
  • 干货 | 以太坊Mist负责人教你建立无服务器应用
  • 网络应用优化——时延与带宽
  • 小程序开发中的那些坑
  • 一些基于React、Vue、Node.js、MongoDB技术栈的实践项目
  • ​​​​​​​STM32通过SPI硬件读写W25Q64
  • ​无人机石油管道巡检方案新亮点:灵活准确又高效
  • # windows 运行框输入mrt提示错误:Windows 找不到文件‘mrt‘。请确定文件名是否正确后,再试一次
  • (1)(1.11) SiK Radio v2(一)
  • (2)STL算法之元素计数
  • (8)STL算法之替换
  • (LeetCode C++)盛最多水的容器
  • (安全基本功)磁盘MBR,分区表,活动分区,引导扇区。。。详解与区别
  • (六)激光线扫描-三维重建
  • (转)jdk与jre的区别
  • (转)关于如何学好游戏3D引擎编程的一些经验
  • .\OBJ\test1.axf: Error: L6230W: Ignoring --entry command. Cannot find argumen 'Reset_Handler'
  • .md即markdown文件的基本常用编写语法
  • .NET CORE 第一节 创建基本的 asp.net core
  • .Net 基于MiniExcel的导入功能接口示例
  • .NET序列化 serializable,反序列化
  • .py文件应该怎样打开?
  • @RestControllerAdvice异常统一处理类失效原因
  • [ 攻防演练演示篇 ] 利用通达OA 文件上传漏洞上传webshell获取主机权限
  • [000-01-018].第3节:Linux环境下ElasticSearch环境搭建
  • [2669]2-2 Time类的定义
  • [8-27]正则表达式、扩展表达式以及相关实战
  • [Android Studio 权威教程]断点调试和高级调试
  • [bug总结]: Feign调用GET请求找不到请求体实体类
  • [C++]类和对象(中)
  • [Cesium学习]
  • [CTF]php is_numeric绕过
  • [CTF夺旗赛] CTFshow Web1-12 详细过程保姆级教程~
  • [C语言][C++][时间复杂度详解分析]二分查找——杨氏矩阵查找数字详解!!!
  • [ERR] 1273 - Unknown collation: ‘utf8mb4_0900_ai_ci‘(已解决)
  • [hdu 1711] Number Sequence [kmp]