我正在尝试使用以下代码连接到 Jupyter Notebook 上的 Snowflake:
import snowflake.connector
这在使用 Python Idle 时运行良好,但在 Jupyter 上出现以下错误:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-4-d11bd0d24b4f> in <module>
----> 1 import snowflake.connector
ModuleNotFoundError: No module named 'snowflake'
我在网上找到的解决方案表明使用以下命令来解决 Jupyter 中的这个问题:
!pip install snowflake-connector-python
import snowflake.connector
但是遇到了:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001E5B5757A88>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/snowflake-connector-python/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001E5B5757288>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/snowflake-connector-python/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001E5B59DDB88>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/snowflake-connector-python/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001E5B59DD0C8>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/snowflake-connector-python/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001E5B59DD2C8>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/snowflake-connector-python/
ERROR: Could not find a version that satisfies the requirement snowflake-connector-python (from versions: none)
ERROR: No matching distribution found for snowflake-connector-python
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-5-f59c5a948575> in <module>
1 get_ipython().system('pip install snowflake-connector-python')
----> 2 import snowflake.connector
ModuleNotFoundError: No module named 'snowflake'
如果我无法安装这个库的原因,请告诉我,如果有任何关于为什么这对我适用于 Python Idle 而不是 Jupyter 笔记本的见解,我将不胜感激。 Python 版本 3.7.9