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.

I have the exct same issue on a Mac. I even tried to install dbt-snowflake, pyarrow etc. individually.Even deleted the venv and stared fresh in a new one. But I get an error at the end of the pip install dbt-snowflake command. Here is the exact error below. As a result I am not getting prompted for the Snowflake DB details to establish a db connection. Any pointers would help!

====Error Output ====

clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/chetanhome/anaconda3/envs/snowpark-dbt/include -fPIC -O2 -isystem /Users/chetanhome/anaconda3/envs/snowpark-dbt/include -Isrc/snowflake/connector/nanoarrow_cpp/ArrowIterator -Isrc/snowflake/connector/nanoarrow_cpp/ArrowIterator -Isrc/snowflake/connector/nanoarrow_cpp/Logging -I/Users/chetanhome/anaconda3/envs/snowpark-dbt/include/python3.10 -c src/snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.cpp -o build/temp.macosx-10.9-x86_64-cpython-310/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.o -std=c++17 -D_GLIBCXX_USE_CXX11_ABI=0 -mmacosx-version-min=10.13
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command ‘/usr/bin/clang’ failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for snowflake-connector-python
Failed to build snowflake-connector-python
ERROR: Could not build wheels for snowflake-connector-python, which is required to install pyproject.toml-based projects

Tried that too. No dice.