iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >python install install cx_Oracle失败问题解决
  • 203
分享到

python install install cx_Oracle失败问题解决

python开发语言 2023-09-10 18:09:37 203人浏览 泡泡鱼

Python 官方文档:入门教程 => 点击学习

摘要

问题背景:在本地机安装失败,但在服务器上安装成功; 环境对比:两个机器的python版本不一致; 报错如下: PS C:\Users\Administrator\Downloads\***\****> pip install cx_orac

问题背景:在本地机安装失败,但在服务器上安装成功;

环境对比:两个机器的python版本不一致;

报错如下:

PS C:\Users\Administrator\Downloads\***\****> 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
  ╰─> [8 lines of output]
      :6: DeprecationWarning: pkg_resources is deprecated as an api. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      C:\Users\Administrator\AppData\Local\Temp\pip-build-env-ln3m6cfk\overlay\Lib\site-packages\setuptools\config\expand.py:132: SetuptoolsWarning: File 'C:\\Users\\Administrator\\App
Data\\Local\\Temp\\pip-install-2wg9p419\\cx-oracle_98b8bf5eb5fa4484a6701af7d917a7e2\\README.md' cannot be found
        return '\n'.join(
      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

[notice] A new release of pip is available: 23.1.2 -> 23.2.1
[notice] To update, run: Python.exe -m pip install --upgrade pip
PS C:\Users\Administrator\Downloads\bayonetProjectApi\bayonetProjectApi> 
 

解决方案:

1、进入cx-Oracle · Pyshou 手动去下载whl依赖,发现没有自己的python对于的文件(原因:可能自己安装的版本过高,导致依赖文件没有,所以失败);

重新安装和服务器上一致的python版本(3.7.9);

再次执行:pip3 install cx_Oracle ;

【如未遇到则忽略此步骤】报错:WARNING: You are using pip version 20.1.1; however, version 23.2.1 is available.
You should consider upgrading via the 'd:\warfile\python\python.exe -m pip install --upgrade pip' command(解决办法,执行:python -m pip install -U --force-reinstall pip);

再次执行:pip3 install cx_Oracle;

成功;

来源地址:https://blog.csdn.net/qq_39689122/article/details/131889513

--结束END--

本文标题: python install install cx_Oracle失败问题解决

本文链接: https://www.lsjlt.com/news/402494.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作