[英]import pycurl: Library not loaded: @rpath/libcrypto.1.1.dylib : Reason: image not found
My flask app python code error's out with below error :我的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
OS: Darwin Kernel Version 18.6.0 - Mojave 10.14.5操作系统:达尔文内核版本 18.6.0 - Mojave 10.14.5
Tried updating brew, openssl (link and unlink, export LDFLAGS, export CFFFLAGS) but nothing appears to work尝试更新 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
Any additional pointers to try.要尝试的任何其他指针。 Thanks in advance
提前致谢
What solved it in my case was changing the path where Python would look for this libs, as they were installed by brew.在我的情况下解决它的是更改 Python 查找此库的路径,因为它们是由 brew 安装的。 But you can tell it to look for the lib somewhere else:
但是你可以告诉它在其他地方寻找 lib:
Add the following at the bottom of your profile file (~/.bashrc or ~/.zshrc, depending on your shell) :在您的配置文件(~/.bashrc 或 ~/.zshrc,取决于您的 shell)底部添加以下内容:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/local/lib
Then restart your shell, and try again (remember to reload your venv if your were using one).然后重新启动你的 shell,再试一次(如果你正在使用一个,请记住重新加载你的 venv)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.