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

MacOS 使用ssh2-python报错ImportError: dlopen ... Library not loaded

环境

  • Apple M3 Pro
  • MacOS 14.1
  • Python 3.9
  • ssh2-python==0.26.0

报错信息

  File "/Users/skyler/Documents/py-env/venv3.9/lib/python3.9/site-packages/pssh/clients/__init__.py", line 19, in <module>from .native.parallel import ParallelSSHClientFile "/Users/skyler/Documents/py-env/venv3.9/lib/python3.9/site-packages/pssh/clients/native/__init__.py", line 19, in <module>from .parallel import ParallelSSHClientFile "/Users/skyler/Documents/py-env/venv3.9/lib/python3.9/site-packages/pssh/clients/native/parallel.py", line 20, in <module>from .single import SSHClientFile "/Users/skyler/Documents/py-env/venv3.9/lib/python3.9/site-packages/pssh/clients/native/single.py", line 24, in <module>from ssh2.error_codes import LIBSSH2_ERROR_EAGAIN
ImportError: dlopen(/Users/skyler/Documents/py-env/venv3.9/lib/python3.9/site-packages/ssh2/error_codes.cpython-39-darwin.so, 0x0002): Library not loaded: /private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-1gzz284h/ssh2-python/src/src/libssh2.1.dylibReferenced from: <F8048C8C-1214-3A6C-A790-0DEAB6514422> /Users/skyler/Documents/py-env/venv3.9/lib/python3.9/site-packages/ssh2/error_codes.cpython-39-darwin.soReason: tried: '/private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-1gzz284h/ssh2-python/src/src/libssh2.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-1gzz284h/ssh2-python/src/src/libssh2.1.dylib' (no such file), '/private/var/folders/90/2z2_gp3s4z737mq6fyxsw6g80000gn/T/pip-install-1gzz284h/ssh2-python/src/src/libssh2.1.dylib' (no such file)

解决方式

brew install libssh2export DYLD_LIBRARY_PATH="$(brew --prefix libssh2)/lib:${DYLD_LIBRARY_PATH}"

安装完依赖的lib后,服务正常运行。


http://www.mrgr.cn/news/58682.html

相关文章:

  • Git创建和拉取项目分支的应用以及Gitlab太占内存,如何配置降低gitlab内存占用进行优化
  • 大数据-190 Elasticsearch - ELK 日志分析实战 - 配置启动 Filebeat Logstash
  • 抖音抖店 API 请求获取宝贝详情数据的调用频率限制如何调整?
  • 算法的学习笔记—数组中只出现一次的数字(牛客JZ56)
  • Android:加载三方应用的小部件到自己APP显示
  • Cesium for UE-04-一些说明
  • 视频AI系统工具:强大的图像识别和分析工具Google Cloud Vision API介绍
  • java高性能处理10G大文件
  • 7、哈希表
  • C#从零开始学习(用户界面)(unity Lab4)
  • 软考:缓存击穿和缓存穿透
  • Vue 自定义指令 Directive 的高级使用与最佳实践
  • 线程池——Java
  • Redis和MySQL如何保证数据一致性
  • 洛谷 P1130 红牌
  • 鸿蒙UI系统组件17——富文本展示(RichText)
  • 批量归一化(Batch Normalization)
  • Python爬虫教程:从入门到精通
  • 考研要求掌握的C语言程度(堆排序)1
  • 【数据结构初阶】二叉树---堆
  • 总结性标题:高效导入文本数据,探索 MySQL 与 Java 的最佳实践
  • kaggle在线训练深度学习模型
  • moment.js 获取相关时间节点(今天、本周、本月、本季度、本年)
  • 安全见闻---清风
  • 2024mathorcup大数据竞赛选题建议及思路来啦!
  • 大数据治理平台建设规划方案(71页WORD)