当前位置: 首页 > 知识库问答 >
问题:

Mac M1上未加载Openssl库(未加载库:/usr/local/opt/Openssl@1.1/lib/libssl.1.1.dylib)

司空皓
2023-03-14

谁能帮帮我吗?我试图在我的Mac上使用pytest在我的venv环境中运行Python自动化测试,但出现了这样一个错误:

库未加载:/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib

brew reinstall openssl@1.1
..........

A CA file has been bootstrapped using certificates from the system keychain. To add additional certificates, place .pem files in   /opt/homebrew/etc/openssl@1.1/certs

and run   /opt/homebrew/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /opt/homebrew, because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH, run:   echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:   export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"   export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"
echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc 
source ~/.zshrc 
export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib" 
export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include" 

echo $PATH 
/Users/danylokholodov/Documents/my-project/Core_Platform/Code/my-project-qa-framework/venv/bin:/opt/homebrew/opt/openssl@1.1/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands

which openssl 
/opt/homebrew/opt/openssl@1.1/bin/openssl

但在执行测试期间仍有相同的错误:

../../../venv/lib/python3.9/site-packages/pymssql/__init__.py:3: in <module>
    from ._pymssql import *
E   ImportError: dlopen(/Users/danylokholodov/Documents/my-project/Core_Platform/Code/my-project-qa-framework/venv/lib/python3.9/site-packages/pymssql/_pymssql.cpython-39-darwin.so, 2): Library not loaded: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib
E     Referenced from: /Users/danylokholodov/Documents/my-project/Core_Platform/Code/my-project-qa-framework/venv/lib/python3.9/site-packages/pymssql/_pymssql.cpython-39-darwin.so
E     Reason: image not found

共有1个答案

万俟经纶
2023-03-14

我通过安装Anaconda修复了它,然后用Conda环境和Python 3.8创建了一个ENV(在我的例子中是Python 3.8,因为3.9不能与Psycopg2一起工作)。然后我从Anaconda->Environments->未安装下载了Pymssql。然后我转到pycharm首选项上的python解释器,选择了anaconda小徽标,然后+,并在env上手动安装了pymssql。

 类似资料:
  • 我以前试图为一个应用程序制作一个新的rails后端。当我尝试将cd放入应用程序时,终端声明:rvm安装“Ruby-2.6.5” 我正在尝试运行rails服务器,当我这样做时,终端中出现了以下错误:

  • 我通过homebrew安装了Vaper,然后立即想通过执行进入一个项目,但随后在终端中返回了以下消息: 我尝试了一些方法来解决这个问题,比如通过brew卸载和重新安装openssl,但都不起作用。我也尝试了一些我在互联网上找到的东西,但没有效果。我假设它与vapor有关,它只适用于1.0.0版本,而不适用1.1.1版本,这就是我所拥有的。我想我需要降级到1.0.0,但我是怎么做到的?如果有关系的话

  • 使用Electrol-Builder构建Windows应用程序,在注册时,我得到了这个错误:

  • 我刚刚用homebrew安装了posgresql,当我继续键入命令时 我收到以下错误: 有人知道哪里出了问题吗?

  • 我正在尝试使用QMK进行设置,为Rama M6-c编写我自己的关键地图。 当运行同样用于rama m6-c的“使wilba_tech/rama_工作”m6_b:default时,我不断收到以下消息: dyld:未加载库:/usr/local/opt/isl/lib/libisl。21.dylib 在我的终端内。 错误消息是 编译器内部错误:中止陷阱:6信号终止程序cc1。 我尝试了QMK网站上提到

  • 我正在Mac OX Snow Leopard(MacPorts)上编译一些C代码。 我收到错误消息: collect2:错误:ld以信号5终止[跟踪/BPT陷阱] dyld:未加载库:/opt/local/lib/libffi。5.dylib 引用自: /opt/local/libexec/llvm-3.3/lib/libLTO.dylib 原因:未找到图像 我知道libffi更新到了一个更新的版