Closed larissalong closed 5 years ago
Try
pip install -U --force-reinstall pycryptodomex
Looks like your PyCryptodome is corrupted.
Try pip install -U --force-reinstall pycryptodomex
Looks like your PyCryptodome is corrupted.
Thanks Shige. After following the step above, I managed to import snowflake in Spyder. However, a new error appeared when I run the below code:
import snowflake.connector
# Gets the version
ctx = snowflake.connector.connect(
user='username',
password='pwd',
account='myaccount'
)
cs = ctx.cursor()
try:
cs.execute("SELECT current_version()")
one_row = cs.fetchone()
print(one_row[0])
finally:
cs.close()
ctx.close()
This is the error message, can you advise how to fix this:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\network.py", line 648, in _request_exec_wrapper
**kwargs)
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\network.py", line 865, in _request_exec
raise RetryRequest(err)
snowflake.connector.network.RetryRequest: module 'Cryptodome' has no attribute 'Util'
2019-04-16 09:14:13,412 - MainThread network.py:905 - _use_requests_session() - DEBUG - Active requests sessions: 0, idle: 1
Traceback (most recent call last):
File "<ipython-input-17-641e71603e0c>", line 4, in <module>
account='petco.us-east-1'
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\__init__.py", line 33, in Connect
return SnowflakeConnection(**kwargs)
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\connection.py", line 175, in __init__
self.connect(**kwargs)
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\connection.py", line 439, in connect
self.__open_connection()
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\connection.py", line 653, in __open_connection
self.__authenticate(auth_instance)
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\connection.py", line 877, in __authenticate
session_parameters=self._session_parameters,
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\auth.py", line 225, in authenticate
socket_timeout=self._rest._connection.login_timeout)
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\network.py", line 530, in _post_request
_include_retry_params=_include_retry_params)
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\network.py", line 608, in fetch
**kwargs)
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\network.py", line 666, in _request_exec_wrapper
conn, full_url, cause)
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\network.py", line 696, in handle_invalid_certificate_error
u'errno': ER_FAILED_TO_REQUEST,
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\errors.py", line 100, in errorhandler_wrapper
connection.errorhandler(connection, cursor, errorclass, errorvalue)
File "C:\Users\338905\AppData\Local\Continuum\anaconda3\lib\site-packages\snowflake\connector\errors.py", line 73, in default_errorhandler
done_format_msg=errorvalue.get(u'done_format_msg'))
OperationalError: 250003: None: Failed to execute request: module 'Cryptodome' has no attribute 'Util'
My code works after I restarted my laptop. Thank you Shige for the help!
I would like to connect to Snowflake via Python connector in Anaconda Spyder.
What I did was to: 1) install snowflake in Anaconda Prompt using 'pip install snowflake-connector-python' 2) then run code 'import snowflake.connector' in Spyder.
There should not be any error shown after I imported the snowflake.connector in Spyder.
However, what I saw instead was shown below:
After I collect the logs by running the below code, It returned 'botocore'.
My info:
What version of Python are you using (
python --version
)?What operating system and processor architecture are you using (
python -c 'import platform; print(platform.platform())'
)?What are the component versions in the environment (
pip list
)?