尝试使用 python 3.9 在 MacOs 13.3.1 (a) 上运行 jupyter-notebook: ImportError: urllib3 v2.0 仅支持 OpenSSL 1.1.1+

Han*_*ans 5 openssl importerror libressl jupyter-notebook

我刚刚通过“pip3 install jupyterlab”安装了 jupyter 笔记本,我将安装目录添加到了我的路径中(/Users//Library/Python/3.9/bin)

python 版本:Python 3.9.6(默认,2023 年 3 月 10 日,20:16:38)[Clang 14.0.3 (clang-1403.0.22.14.1)] 达尔文

点版本:23.1.2

jupyter --version 选定的 Jupyter 核心包... IPython:8.13.2 ipykernel:6.22.0 ipywidgets:未安装 jupyter_client:8.2.0 jupyter_core:5.3.0 jupyter_server:2.5.0 jupyterlab:未安装 nbclient:0.7.4 nbconvert : 7.3.1 nbformat : 5.8.0 笔记本 : 6.5.4 qtconsole : 未安装 Traitlets : 5.9.0

我可以启动 jupyter-notebook,但是当我尝试运行导入命令(如“import openai”)时,出现以下错误:

“ImportError:urllib3 v2.0 仅支持 OpenSSL 1.1.1+,当前 'ssl' 模块是使用 LibreSSL 2.8.3 编译的。请参阅: https: //github.com/urllib3/urllib3/issues/2168”

我实在不明白这一点。“which openssl”将我指向 /usr/bin/openssl 和 /usr/bin/openssl 版本返回 LibreSSL 3.3.6

我还做了一些谷歌搜索并查找了https://github.com/urllib3/urllib3/issues/2168,但我没有找到问题的解决方案。

如果有人能给我指出正确的方向,我将不胜感激。谢谢大家!

小智 20

我有一个类似的问题,对我有用。我使用安装了所需的版本

pip3 install "urllib3 <=1.26.15"
Run Code Online (Sandbox Code Playgroud)