1

I need help getting Snowflake-Python connector package to work in a Pycharm Scientific mode project.

When I previously setup the Snowflake-Python connector in a non-Scientific mode project I could simply picked it from the Project Intepreter -available packages screen (see Screenshot 1)

However for the Scientific Mode Project the connector does not appear at all in the available projects screen (Screenshot 2)

When I looked up the documentation I found this set of instructions for Scientific mode snowflake-python connector. https://www.jetbrains.com/help/pycharm/connecting-to-a-database.html

I performed all theb steps, but when I run the project I get these errors ("no module named snowflake"): APPRECIATE ANY HELP TOWARDS RESOLVING THIS!

 Python 3.7.5 (default, Oct 25 2019, 10:52:18) 
[Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
runfile('/Users/raman.bhatia/PycharmProjects/EikonAnalyticsScientific/main.py', wdir='/Users/raman.bhatia/PycharmProjects/EikonAnalyticsScientific')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Users/raman.bhatia/PycharmProjects/EikonAnalyticsScientific/main.py", line 1, in <module>
    import snowflake.connector as sf
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'snowflake'

enter image description here

enter image description here

CoolDocMan
  • 637
  • 7
  • 29

1 Answers1

1

A clarification- the docs you linked to are installing the SQL driver for Pycharm's database tool, not installing the python snowflake library.

The reason your install isn't working is that Scientific mode uses a different python binary than regular python (Conda). Conda has their own package manager which isn't pypi.org. Snowflake is published to pypi.org.

I don't have conda handy, but I believe you can fix this by adding pypi. Go to the "add a package" screen you took that screenshot of. Click "Manage Repositories" and add https://pypi.python.org/simple. This should have conda check both its own repositories AND pypi.

Paul Becotte
  • 9,767
  • 3
  • 34
  • 42