Pip 启用在Cygwin上安装pyodbc时执行gcc

Pip 启用在Cygwin上安装pyodbc时执行gcc,pip,cygwin,pyodbc,Pip,Cygwin,Pyodbc,因此,我在Windows上使用Cygwin并尝试安装pyodbc,但出现以下错误。我有两个问题: 1-如何解决此错误并安装pyodbc 2-安装时可以在Cygwin上安装一些软件包。然而,我在一家安全性很高的公司工作,每次我需要安装软件包时,我都需要打电话给IT部门。当我想apt-get-install时,有没有办法避免这种情况 $ pip3 install pyodbc Collecting pyodbc Using cached pyodbc-4.0.30.tar.gz (266 kB)

因此,我在Windows上使用Cygwin并尝试安装pyodbc,但出现以下错误。我有两个问题: 1-如何解决此错误并安装pyodbc 2-安装时可以在Cygwin上安装一些软件包。然而,我在一家安全性很高的公司工作,每次我需要安装软件包时,我都需要打电话给IT部门。当我想
apt-get-install
时,有没有办法避免这种情况

$ pip3 install pyodbc
Collecting pyodbc
  Using cached pyodbc-4.0.30.tar.gz (266 kB)
Building wheels for collected packages: pyodbc
  Building wheel for pyodbc (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-it4lbnab/pyodbc_7ecc5f1404444b59804b3bea7f531f2c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-it4lbnab/pyodbc_7ecc5f1404444b59804b3bea7f531f2c/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'"'"'))' bdist_wheel -d /tmp/pip-wheel-8kxd4enk
       cwd: /tmp/pip-install-it4lbnab/pyodbc_7ecc5f1404444b59804b3bea7f531f2c/
  Complete output (10 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'pyodbc' extension
  creating build
  creating build/temp.cygwin-3.2.0-x86_64-3.6
  creating build/temp.cygwin-3.2.0-x86_64-3.6/src
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python36/python36-3.6.13-2.x86_64/build=/usr/src/debug/python36-3.6.13-2 -fdebug-prefix-map=/pub/devel/python/python36/python36-3.6.13-2.x86_64/src/Python-3.6.13=/usr/src/debug/python36-3.6.13-2 -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python36/python36-3.6.13-2.x86_64/build=/usr/src/debug/python36-3.6.13-2 -fdebug-prefix-map=/pub/devel/python/python36/python36-3.6.13-2.x86_64/src/Python-3.6.13=/usr/src/debug/python36-3.6.13-2 -DPYODBC_VERSION=4.0.30 -I/usr/include/python3.6m -c src/buffer.cpp -o build/temp.cygwin-3.2.0-x86_64-3.6/src/buffer.o
  unable to execute 'gcc': No such file or directory
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyodbc
  Running setup.py clean for pyodbc
Failed to build pyodbc
Installing collected packages: pyodbc
    Running setup.py install for pyodbc ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-it4lbnab/pyodbc_7ecc5f1404444b59804b3bea7f531f2c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-it4lbnab/pyodbc_7ecc5f1404444b59804b3bea7f531f2c/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 /tmp/pip-record-1yowmoni/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.6m/pyodbc
         cwd: /tmp/pip-install-it4lbnab/pyodbc_7ecc5f1404444b59804b3bea7f531f2c/
    Complete output (10 lines):
    running install
    running build
    running build_ext
    building 'pyodbc' extension
    creating build
    creating build/temp.cygwin-3.2.0-x86_64-3.6
    creating build/temp.cygwin-3.2.0-x86_64-3.6/src
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python36/python36-3.6.13-2.x86_64/build=/usr/src/debug/python36-3.6.13-2 -fdebug-prefix-map=/pub/devel/python/python36/python36-3.6.13-2.x86_64/src/Python-3.6.13=/usr/src/debug/python36-3.6.13-2 -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python36/python36-3.6.13-2.x86_64/build=/usr/src/debug/python36-3.6.13-2 -fdebug-prefix-map=/pub/devel/python/python36/python36-3.6.13-2.x86_64/src/Python-3.6.13=/usr/src/debug/python36-3.6.13-2 -DPYODBC_VERSION=4.0.30 -I/usr/include/python3.6m -c src/buffer.cpp -o build/temp.cygwin-3.2.0-x86_64-3.6/src/buffer.o
    unable to execute 'gcc': No such file or directory
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-it4lbnab/pyodbc_7ecc5f1404444b59804b3bea7f531f2c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-it4lbnab/pyodbc_7ecc5f1404444b59804b3bea7f531f2c/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 /tmp/pip-record-1yowmoni/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.6m/pyodbc Check the logs for full command output.

您安装了gcc编译器吗?为什么将pip3链接到Python 3.6,因为默认值为3.8?关于安装,您是否尝试过
setup-x86_64.exe-B
?它不会升高,只允许安装您的设备user@matzeri谢谢,我不知道为什么。实际上我已经安装了Python 3.9,所以我必须检查它为什么链接到3.6。@matzeri命令
setup-x86_64.exe-B
工作得很好。有可能在任何软件安装中使用此技巧吗?那会很神奇。我从一家低安全性的公司搬到了高安全性的公司,这是一件痛苦的事情。最后是3.8.10。看起来您正在混合使用Windows和Cygwin版本的python