目录

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

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”:

  • error: subprocess-exited-with-error

    https://i-blog.csdnimg.cn/direct/eae9c89c90de474996567f86f8bc6c49.png

二、原因

上面所有报错,其实关键是下面这条报错造成,是因为电脑缺少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”:

三、解决方案

最简单方法下载一个社区版的visualstudio IDE,里面把C++编译器选上安装, 。

https://i-blog.csdnimg.cn/direct/ec80c7f2df484301b09c835a6a433537.png

https://i-blog.csdnimg.cn/direct/49bb917e15be421683a89a9ae74fbdbd.png

https://i-blog.csdnimg.cn/direct/05a444647caa4772aa1d759ed996ebea.png

https://i-blog.csdnimg.cn/direct/d1179c6bbda94a50a2870174ec022a6f.png

https://i-blog.csdnimg.cn/direct/cf1f3aee59534e77896ea66d988ce3f3.png