我的 flask 应用程序 python 代码出现以下错误:
Traceback (most recent call last):
File "######.py",
import pycurl
ImportError: dlopen(/Users/########/Library/Python/3.7/lib/python/site-packages/pycurl.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libcrypto.1.1.dylib
Referenced from: /Users/########/Library/Python/3.7/lib/python/site-packages/pycurl.cpython-37m-darwin.so
Reason: image not found
操作系统: Darwin 内核版本 18.6.0 - Mojave 10.14.5
尝试更新 brew, openssl(链接和取消链接、导出 LDFLAGS、导出 CFFFLAGS)但似乎没有任何效果
$ brew install openssl
openssl 1.0.2s is already installed and up-to-date
$brew install curl-openssl
curl-openssl 7.65.3 is already installed and up-to-date
任何额外的尝试。提前致谢
最佳答案
在我的案例中,解决这个问题的方法是改变 Python 查找这些库的路径,因为它们是由 brew 安装的。但是您可以告诉它在其他地方寻找库:
在您的配置文件底部添加以下内容(~/.bashrc 或 ~/.zshrc,具体取决于您的 shell):
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/local/lib
然后重新启动您的 shell,然后重试(如果您正在使用,请记住重新加载您的 venv)。
关于python - 导入 pycurl : Library not loaded: @rpath/libcrypto. 1.1.dylib:原因:找不到图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57258897/
相关文章:
python-3.x - 属性错误 : 'NoneType' object has no attri
javascript - 如何在 Google TimeLine 图表中仅在一行中设置一个条形图(带
google-cloud-storage - 与 Google Cloud Storage 的连接池
svelte - 将选定的 Svelte 组件编译为 CustomElements
c# - EF Core - 无法添加具有相同相关对象的实体
typescript - VS代码/w。在 TypeScript Monorepo 中更漂亮
javascript - 在 Angular 6 中处理来自第三方 URL 的发布响应。无法发布错误
python - 如何使用分类变量和数值变量绘制相关矩阵/热图