简体   繁体   English

安装snowflake-connector-python 时出错

[英]Error while installing snowflake-connector-python

I need to install python connector for running a script to load data into Snowflake.我需要安装 python 连接器来运行脚本以将数据加载到雪花中。 When I run the command "pip install snowflake-connector-python", I am getting many errors related to C-complier and numpy.当我运行命令“pip install snowflake-connector-python”时,我收到许多与 C 编译器和 numpy 相关的错误。 Python version is 3.8 and pip is upgraded as well. Python 版本是 3.8,pip 也升级了。 Kindly help me to resolve the package installation issue.请帮助我解决软件包安装问题。

Below is the list of errors from command prompt:以下是命令提示符下的错误列表:

        **compiling C sources
        creating build\temp.win-amd64-3.9\Release\numpy\random
        creating build\temp.win-amd64-3.9\Release\numpy\random\mtrand
        C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe
/c /nologo /Ox /W3 /GL /DNDEBUG /MD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNPY_NEEDS_MIN
GW_TIME_WORKAROUND -Inumpy\core\include -Ibuild\src.win-amd64-3.9\numpy\core\include/numpy -Inumpy\core\src\common -Inum
py\core\src -Inumpy\core -Inumpy\core\src\npymath -Inumpy\core\src\multiarray -Inumpy\core\src\umath -Inumpy\core\src\np
ysort -Ic:\program files\python39\include -Ic:\program files\python39\include -Ibuild\src.win-amd64-3.9\numpy\core\src\c
ommon -Ibuild\src.win-amd64-3.9\numpy\core\src\npymath -Ibuild\src.win-amd64-3.9\numpy\core\src\common -Ibuild\src.win-a
md64-3.9\numpy\core\src\npymath -IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.270
23\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\i
nclude\10.0.17763.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um -IC:\Program Files (x86)\Win
dows Kits\10\include\10.0.17763.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt /Tcnumpy\
random\mtrand\mtrand.c /Fobuild\temp.win-amd64-3.9\Release\numpy\random\mtrand\mtrand.obj
        mtrand.c
        numpy\random\mtrand\mtrand.c(35419): warning C4244: '=': conversion from 'npy_intp' to 'long', possible loss of
data
        numpy\random\mtrand\mtrand.c(35429): warning C4244: 'function': conversion from 'npy_intp' to 'long', possible l
oss of data
        numpy\random\mtrand\mtrand.c(35496): warning C4244: '=': conversion from 'npy_intp' to 'long', possible loss of
data
        numpy\random\mtrand\mtrand.c(36796): warning C4244: 'function': conversion from 'npy_intp' to 'unsigned long', p
ossible loss of data
        numpy\random\mtrand\mtrand.c(36980): warning C4244: 'function': conversion from 'npy_intp' to 'unsigned long', p
ossible loss of data
        numpy\random\mtrand\mtrand.c(37143): warning C4244: 'function': conversion from 'npy_intp' to 'unsigned long', p
ossible loss of data
        numpy\random\mtrand\mtrand.c(40343): warning C4146: unary minus operator applied to unsigned type, result still
unsigned
        numpy\random\mtrand\mtrand.c(40400): error C2039: 'tp_print': is not a member of '_typeobject'
        c:\program files\python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
        numpy\random\mtrand\mtrand.c(42673): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
        c:\program files\python39\include\cpython/unicodeobject.h(446): note: see declaration of '_PyUnicode_get_wstr_le
ngth'
        numpy\random\mtrand\mtrand.c(42689): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
        c:\program files\python39\include\cpython/unicodeobject.h(446): note: see declaration of '_PyUnicode_get_wstr_le
ngth'
        error: Command "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\Hos
tX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1
 -DNPY_NEEDS_MINGW_TIME_WORKAROUND -Inumpy\core\include -Ibuild\src.win-amd64-3.9\numpy\core\include/numpy -Inumpy\core\
src\common -Inumpy\core\src -Inumpy\core -Inumpy\core\src\npymath -Inumpy\core\src\multiarray -Inumpy\core\src\umath -In
umpy\core\src\npysort -Ic:\program files\python39\include -Ic:\program files\python39\include -Ibuild\src.win-amd64-3.9\
numpy\core\src\common -Ibuild\src.win-amd64-3.9\numpy\core\src\npymath -Ibuild\src.win-amd64-3.9\numpy\core\src\common -
Ibuild\src.win-amd64-3.9\numpy\core\src\npymath -IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tool
s\MSVC\14.16.27023\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt -IC:\Program Files (x86)\W
indows Kits\10\include\10.0.17763.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um -IC:\Program
 Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cp
pwinrt /Tcnumpy\random\mtrand\mtrand.c /Fobuild\temp.win-amd64-3.9\Release\numpy\random\mtrand\mtrand.obj" failed with e
xit status 2
        ----------------------------------------
    ERROR: Command errored out with exit status 1: 'c:\program files\python39\python.exe' -u -c 'import sys, setuptools,
 tokenize; sys.argv[0] = '"'"'C:\\Users\\alarmdsys\\AppData\\Local\\Temp\\2\\pip-install-uvtm9ird\\numpy\\setup.py'"'"';
 __file__='"'"'C:\\Users\\alarmdsys\\AppData\\Local\\Temp\\2\\pip-install-uvtm9ird\\numpy\\setup.py'"'"';f=getattr(token
ize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __
file__, '"'"'exec'"'"'))' install --record 'C:\Users\alarmdsys\AppData\Local\Temp\2\pip-record-_15ijsu3\install-record.t
xt' --single-version-externally-managed --prefix 'C:\Users\alarmdsys\AppData\Local\Temp\2\pip-build-env-xh61rxin\overlay
' --compile --install-headers 'C:\Users\alarmdsys\AppData\Local\Temp\2\pip-build-env-xh61rxin\overlay\Include\numpy' Che
ck the logs for full command output.
    ----------------------------------------
  ERROR: Command errored out with exit status 1: 'c:\program files\python39\python.exe' 'c:\program files\python39\lib\s
ite-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\alarmdsys\AppData\Local\Temp\2\pip-build-env-x
h61rxin\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'cython
 >= 0.29' 'numpy==1.14.5; python_version<'"'"'3.7'"'"'' 'numpy==1.16.0; python_version>='"'"'3.7'"'"'' setuptools setupt
ools_scm wheel Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files\python39\python.exe' 'c:\program files\python39\lib\sit
e-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\alarmdsys\AppData\Local\Temp\2\pip-build-env-a5q
k21fh\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptoo
ls>=40.6.0' wheel cython 'pyarrow>=0.17.0,<0.18.0' Check the logs for full command output.**

You seem to be using python 3.9.您似乎在使用 python 3.9。 for this setup, as can be seen from your error message:对于此设置,从您的错误消息中可以看出:

ERROR: Command errored out with exit status 1: 'c:\program files\python39\python.exe'

And it is failing while installing numpy , which can be quite tricky to compile from source and is not officially released for python 3.9 yet.它在安装numpy失败,从源代码编译可能非常棘手,并且尚未正式发布用于 python 3.9。

Python version is 3.8 Python 版本是 3.8

At least your setup is using a 3.9.至少您的设置使用的是 3.9。 version.版本。 Looking on pypi , whl files for snowflake-connector-python only go up to python 3.7, but you can still try to install from source using your python 3.8 by typing:查看pypisnowflake-connector-python whl 文件只能升级到 python 3.7,但您仍然可以尝试使用 python 3.8 从源代码安装:

c:\program files\python38\python.exe -m pip install snowflake-connector-python

(replace c:\\program files\\python38\\python.exe with the path to your python 3.8. executable) (将c:\\program files\\python38\\python.exe替换为 python 3.8. 可执行文件的路径)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM