0

I have a virtual environment with Python 3.11.0 in it. When trying to install cx-Oracle

pip install cx-Oracle

Is there any way to make it work with python 3.11?

Full error:

(venv) PS C:\Users\XXXXX\Pruebas\sp-back-office-toolscoe> pip install cx-Oracle
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
  ╰─> [7 lines of output]
      C:\Users\XXXXX\AppData\Local\Temp\pip-build-env-__332i7h\overlay\Lib\site-packages\setuptools\config\expand.py:144: UserWarning: File 'C:\\Users
\\XXXXXX\\AppData\\Local\\Temp\\pip-install-akmlg3ac\\cx-oracle_559c2c2b67a543f586a98b0333592264\\README.md' cannot be found
        warnings.warn(f"File {path!r} cannot be found")
      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-bu
      [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

As the error suggests, I have installed Microsoft C++ Build Tools and added it to my path, but I still get the same error. Not sure what should I do.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Javi Torre
  • 724
  • 8
  • 23
  • 1
    You may need to upgrade `pip` first. – metatoaster Feb 03 '23 at 07:45
  • I have already tried, no luck, my current pip version is 23.0 It also says Note: This error originates from a subprocess, and is likely not a problem with pip. – Javi Torre Feb 03 '23 at 07:46
  • 1
    Would be useful to include a complete trace, see an example such as [this thread](https://stackoverflow.com/questions/70790424/pip-error-cannot-build-wheels-for-sip-which-is-required-to-install-pyproject). – metatoaster Feb 03 '23 at 07:47
  • That´s the trace added, apologies. – Javi Torre Feb 03 '23 at 07:56
  • Apologies, I found the answer https://stackoverflow.com/questions/64261546/how-to-solve-error-microsoft-visual-c-14-0-or-greater-is-required-when-inst – Javi Torre Feb 03 '23 at 08:34
  • 1
    The latest version of cx_Oracle, now called [python-oracledb](https://cjones-oracle.medium.com/open-source-python-thin-driver-for-oracle-database-e82aac7ecf5a) does have binary packages for Python 3.11. Upgrade to this version and you won't need a compiler. This is the solution to the question about support for Python 3.11 – Christopher Jones Feb 04 '23 at 22:20

0 Answers0