snowflake-sqlalchemy icon indicating copy to clipboard operation
snowflake-sqlalchemy copied to clipboard

TypeError: 'NoneType' object is not callable

Open IzekChen opened this issue 4 years ago • 1 comments

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using (python --version)?

3.8.2

  1. What operating system and processor architecture are you using (python -c 'import platform; print(platform.platform())')?

macOS-10.13.6-x86_64-i386-64bit

  1. What are the component versions in the environment (pip list)?

Package Version


asn1crypto 1.3.0
azure-common 1.1.25
azure-storage-blob 2.1.0
azure-storage-common 2.1.0
boto3 1.11.17
botocore 1.14.17
certifi 2020.4.5.1 cffi 1.13.2
chardet 3.0.4
cryptography 2.9.2
docutils 0.15.2
idna 2.9
ijson 2.6.1
jmespath 0.9.5
oscrypto 1.2.0
pip 20.0.2
pycparser 2.20
pycryptodomex 3.9.7
PyJWT 1.7.1
pyOpenSSL 19.1.0
python-dateutil 2.8.1
pytz 2020.1
requests 2.23.0
s3transfer 0.3.3
setuptools 46.0.0
six 1.14.0
snowflake-connector-python 2.2.4
snowflake-sqlalchemy 1.2.3
SQLAlchemy 1.3.16
urllib3 1.25.9
wheel 0.34.2

  1. What did you do? If possible, provide a recipe for reproducing the error. A complete runnable program is good.

try to run the validate.py, but It fail when I only run the code below

only run the command below

from sqlalchemy import create_engine engine = create_engine( 'snowflake://testuser1:[email protected]/testdb/public?warehouse=testwh&role=myrole' )

  1. What did you expect to see?

no error and I can run the validate code

  1. What did you see instead?

File "snowflake.py", line 28, in engine = create_engine( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/init.py", line 479, in create_engine return strategy.create(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/strategies.py", line 61, in create entrypoint = u._get_entrypoint() File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/url.py", line 172, in _get_entrypoint cls = registry.load(name) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 259, in load import pkg_resources File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 3255, in def _initialize_master_working_set(): File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 3238, in _call_aside f(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 3280, in _initialize_master_working_set tuple( File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 3281, in dist.activate(replace=False) File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 2788, in activate declare_namespace(pkg) File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 2286, in declare_namespace _handle_ns(packageName, path_item) File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 2219, in _handle_ns loader.load_module(packageName) File "/Users/izekc/Github/Leetcode-practice/practice/snowflake.py", line 28, in engine = create_engine( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/init.py", line 479, in create_engine return strategy.create(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/strategies.py", line 61, in create entrypoint = u._get_entrypoint() File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/url.py", line 172, in _get_entrypoint cls = registry.load(name) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 263, in load for impl in pkg_resources.iter_entry_points(self.group, name): TypeError: 'NoneType' object is not callable

  1. Can you set logging to DEBUG and collect the logs?
import logging
import os

for logger_name in ['snowflake.sqlalchemy', 'snowflake.connector', 'botocore']: 
    logger = logging.getLogger(logger_name)
    logger.setLevel(logging.DEBUG)
    ch = logging.StreamHandler()
    ch.setLevel(logging.DEBUG)
    ch.setFormatter(logging.Formatter('%(asctime)s - %(threadName)s %(filename)s:%(lineno)d - %(funcName)s() - %(levelname)s - %(message)s'))
    logger.addHandler(ch)

Same us the log at 6.

Traceback (most recent call last): File "snowflake.py", line 44, in engine = create_engine( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/init.py", line 479, in create_engine return strategy.create(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/strategies.py", line 61, in create entrypoint = u._get_entrypoint() File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/url.py", line 172, in _get_entrypoint cls = registry.load(name) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 259, in load import pkg_resources File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 3255, in def _initialize_master_working_set(): File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 3238, in _call_aside f(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 3280, in _initialize_master_working_set tuple( File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 3281, in dist.activate(replace=False) File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 2788, in activate declare_namespace(pkg) File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 2286, in declare_namespace _handle_ns(packageName, path_item) File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 2219, in _handle_ns loader.load_module(packageName) File "/Users/izekc/Github/Leetcode-practice/practice/snowflake.py", line 44, in engine = create_engine( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/init.py", line 479, in create_engine return strategy.create(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/strategies.py", line 61, in create entrypoint = u._get_entrypoint() File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/url.py", line 172, in _get_entrypoint cls = registry.load(name) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 263, in load for impl in pkg_resources.iter_entry_points(self.group, name): TypeError: 'NoneType' object is not callable

IzekChen avatar Apr 28 '20 15:04 IzekChen

I was able to fix this by doing:

pip install --upgrade setuptools

It upgraded me from 47.1.0 to 57.0.0.

benekastah avatar Jun 24 '21 19:06 benekastah

To clean up and re-prioritize bugs and feature requests we are closing all issues older than 6 months as of Apr 1, 2023. If there are any issues or feature requests that you would like us to address, please re-create them. For urgent issues, opening a support case with this link Snowflake Community is the fastest way to get a response

github-actions[bot] avatar Apr 05 '23 01:04 github-actions[bot]