Anaconda 3 Jupyter笔记本无法导入ssl,但是使用Atom终端导入ssl没问题。
我正在尝试在Jupyter笔记本中导入ssl,但出现以下错误:
C:\ProgramData\Anaconda3\lib\ssl.py in <module>
96 from enum import Enum as _Enum, IntEnum as _IntEnum, IntFlag as _IntFlag
97
---> 98 import _ssl # if we can't import it, let the error propagate
99
100 from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
ImportError: DLL load failed: The specified procedure could not be found.
但是如果我在Atom终端中运行python(大概是调用Python而不是Anaconda)并导入ssl。完全没有问题。我什至可以查看OpenSSL版本,该版本是
>>> python
>>> import ssl
>>> ssl.OPENSSL_VERSION
>>> 'OpenSSL 1.1.0i 14 Aug 2018'
我尝试将Anaconda3安装目录'C:\ ProgramData \ Anaconda3'添加到系统路径,但是它不起作用。我试图卸载并重新安装Anaconda3,但它也不起作用。
Anaconda3中的python版本和独立的Python均为3.7.1,操作系统为Windows 8.1。而Anaconda3的系统信息如下:
(base) C:\Windows\system32>conda info -s
sys.version: 3.7.1 (default, Dec 10 2018, 22:54:23) [...
sys.prefix: C:\ProgramData\Anaconda3
sys.executable: C:\ProgramData\Anaconda3\python.exe
conda location: C:\ProgramData\Anaconda3\lib\site-packages\conda
conda-build: C:\ProgramData\Anaconda3\Scripts\conda-build.exe
conda-convert: C:\ProgramData\Anaconda3\Scripts\conda-convert.exe
conda-debug: C:\ProgramData\Anaconda3\Scripts\conda-debug.exe
conda-develop: C:\ProgramData\Anaconda3\Scripts\conda-develop.exe
conda-env: C:\ProgramData\Anaconda3\Scripts\conda-env.exe
conda-index: C:\ProgramData\Anaconda3\Scripts\conda-index.exe
conda-inspect: C:\ProgramData\Anaconda3\Scripts\conda-inspect.exe
conda-metapackage: C:\ProgramData\Anaconda3\Scripts\conda-metapackage.exe
conda-render: C:\ProgramData\Anaconda3\Scripts\conda-render.exe
conda-server: C:\ProgramData\Anaconda3\Scripts\conda-server.exe
conda-skeleton: C:\ProgramData\Anaconda3\Scripts\conda-skeleton.exe
conda-verify: C:\ProgramData\Anaconda3\Scripts\conda-verify.exe
user site dirs:
CIO_TEST: <not set>
CONDA_DEFAULT_ENV: base
CONDA_EXE: C:\ProgramData\Anaconda3\Scripts\conda.exe
CONDA_PREFIX: C:\ProgramData\Anaconda3
CONDA_PROMPT_MODIFIER: (base)
CONDA_PYTHON_EXE: C:\ProgramData\Anaconda3\python.exe
CONDA_ROOT: C:\ProgramData\Anaconda3
CONDA_SHLVL: 1
HOMEPATH: \Users\J
PATH: C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Library\mingw-w64\bin;C:
\ProgramData\Anaconda3\Library\usr\bin;C:\ProgramData\Anaconda3\Library\bin;C:\P
rogramData\Anaconda3\Scripts;C:\ProgramData\Anaconda3\bin;
PSMODULEPATH: C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PYTHONIOENCODING: 936
REQUESTS_CA_BUNDLE: <not set>
SSL_CERT_FILE: <not set>