0

我在我的电脑上安装了 openssl

brew install openssl
brew link --force openssl

如果我想用 python 或烧瓶运行它,我会收到如下错误。

FLASK_ENV=development python -m {APP_PATH}.wsgi                     

输出:

  File "/Users/sumeyyeozkaynak/.virtualenvs/OptiwisdomSystemPants/lib/python3.7/site-packages/firebase_admin/_utils.py", line 21, in <module>
    import httplib2
  File "/Users/sumeyyeozkaynak/.virtualenvs/OptiwisdomSystemPants/lib/python3.7/site-packages/httplib2/__init__.py", line 40, in <module>
    import ssl
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 98, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: dlopen(/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so
  Reason: image not found
4

1 回答 1

0

解决方案:当我使用“brew install OpenSSL”安装时,我看到它覆盖了 python 文件。这使我无法运行以前烧瓶的 python 项目。

我用brew安装了python,我用virtualenvwrapper安装了虚拟环境。我删除了所有(python和virtualenvwrapper)

用 pyenv 安装了 python 和虚拟环境。我的 Flask 项目成功了。

于 2020-03-31T05:45:01.857 回答