pip install dbt-snowflake (ERROR: Failed building wheel for snowflake-connector-python (WINDOWS))

I get an error when trying to run pip install dbt-snowflake

ERROR: Command errored out with exit status 1:
command: ‘C:\Users\maaaz\Desktop\dbt_snowflake\venv\Scripts\python.exe’ -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’“‘C:\Users\maaaz\AppData\Local\Temp\pip-install-gh031_31\backports-datetime-fromisoformat_546fe2693e4042fc9892c35972252bd4\setup.py’”’“‘; file=’”‘“‘C:\Users\maaaz\AppData\Local\Temp\pip-install-gh031_31\backports-datetime-fromisoformat_546fe2693e4042fc9892c35972252bd4\setup.py’”’“';f = getattr(tokenize, '”‘“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’“‘))’ install --record ‘C:\Users\maaaz\AppData\Local\Temp\pip-record-j3kw5w4m\install-record.txt’ --single-version-externally-managed --compile --install-headers ‘C:\Users\maaaz\Desktop\dbt_snowflake\venv\include\site\python3.6\backports-datetime-fromisoformat’
cwd: C:\Users\maaaz\AppData\Local\Temp\pip-install-gh031_31\backports-datetime-fromisoformat_546fe2693e4042fc9892c35972252bd4
Complete output (14 lines):
running install
C:\Users\maaaz\Desktop\dbt_snowflake\venv\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\backports
copying backports_init_.py → build\lib.win-amd64-3.6\backports
creating build\lib.win-amd64-3.6\backports\datetime_fromisoformat
copying backports\datetime_fromisoformat_init_.py → build\lib.win-amd64-3.6\backports\datetime_fromisoformat
running build_ext
building ‘backports._datetime_fromisoformat’ extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: Microsoft C++ Build Tools - Visual Studio
----------------------------------------
ERROR: Command errored out with exit status 1: ‘C:\Users\maaaz\Desktop\dbt_snowflake\venv\Scripts\python.exe’ -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '”‘“‘C:\Users\maaaz\AppData\Local\Temp\pip-install-gh031_31\backports-datetime-fromisoformat_546fe2693e4042fc9892c35972252bd4\setup.py’”’“‘; file=’”‘“‘C:\Users\maaaz\AppData\Local\Temp\pip-install-gh031_31\backports-datetime-fromisoformat_546fe2693e4042fc9892c35972252bd4\setup.py’”’“';f = getattr(tokenize, '”‘“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ install --record ‘C:\Users\maaaz\AppData\Local\Temp\pip-record-j3kw5w4m\install-record.txt’ --single-version-externally-managed --compile --install-headers ‘C:\Users\maaaz\Desktop\dbt_snowflake\venv\include\site\python3.6\backports-datetime-fromisoformat’ Check the logs for full command output.

What command did you run to generate that error output?

Note: @Owen originally posted this reply in Slack. It might not have transferred perfectly.

  1. try it in a venv
  2. try it on python 3.10 or less
1 Like

I’ve installed on Python 3.11.

Agree that installing in a clean environment (such as through venv) is the easiest way to show that it’s an environment problem.

I would try to install other library like :slight_smile:
pip install snowflake-connector-python and see what happens.