Win11基于anaconda pip安装cx_Oracle库报错ERROR: Failed building wheel for cx_Oracle

一、问题描述

windows系统在Anaconda prompt运行

pip install cx_Oracle

安装cx_Oracle库报错,python版本3.12.7,报错:

  • ERROR: Failed to build installable wheels for some pyproject.toml based projects (cx_Oracle)
  • ERROR: Failed building wheel for cx_Oracle
  • error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: https://visualstudio.microsoft.com/visual-cpp-build-tools/
  • error: subprocess-exited-with-error
    在这里插入图片描述

二、原因

上面所有报错,其实关键是下面这条报错造成,是因为电脑缺少Microsoft Visual C++ 14.0 or greater 的编译器,下载并安装Microsoft Visual C++ Build Tools后即可解决问题。

error: Microsoft Visual C++ 14.0 or greater is required. Get it with
“Microsoft C++ Build Tools”:
https://visualstudio.microsoft.com/visual-cpp-build-tools/

三、解决方案

最简单方法下载一个社区版的visualstudio IDE,里面把C++编译器选上安装,VisualStudio免费社区版下载
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

(base) PS C:\Users\86172.亦甜> pip install cx_Oracle Defaulting to user installation because normal site-packages is not writeable Collecting cx_Oracle Using cached cx_Oracle-8.3.0.tar.gz (363 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: cx_Oracle Building wheel for cx_Oracle (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for cx_Oracle (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [21 lines of output] <string>:6: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. C:\Users\86172.亦甜\AppData\Local\Temp\pip-build-env-8jo88sgn\overlay\Lib\site-packages\setuptools\config\expand.py:126: SetuptoolsWarning: File 'C:\\Users\\86172.亦甜\\AppData\\Local\\Temp\\pip-install-it9ofuh3\\cx-oracle_38869229756c4b35995ef75f50a7ce8d\\README.md' cannot be found return '\n'.join( C:\Users\86172.亦甜\AppData\Local\Temp\pip-build-env-8jo88sgn\overlay\Lib\site-packages\setuptools\dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: BSD License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! self._finalize_license_expression() running bdist_wheel running build running build_ext building 'cx_Oracle' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for cx_Oracle Failed to build cx_Oracle ERROR: Could not build wheels for cx_Oracle, which is required to install pyproject.toml-based projects
最新发布
06-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值