政工网站建设方案,城乡建设厅官方网站,优秀网站主题,wordpress云在 MacOS M系列处理器上使用 Anaconda 开发 Oralce 的Python程序
因oracle官方驱动暂无 苹果 M 系列处理器版本#xff0c;所以使用Arm的python解释器报驱动错误#xff1a;
cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: dlop…在 MacOS M系列处理器上使用 Anaconda 开发 Oralce 的Python程序
因oracle官方驱动暂无 苹果 M 系列处理器版本所以使用Arm的python解释器报驱动错误
cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: dlopen(libclntsh.dylib, 0x0001): tried: /Users/xxx/software/oracle/instantclient_19_8/libclntsh.dylib (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e))), libclntsh.dylib (no such file), /usr/lib/libclntsh.dylib (no such file), /Users/xxx/software/oracle/instantclient_19_8/libclntsh.dylib (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e))), /Users/xxx/Project/PyProject/libclntsh.dylib (no such file). See https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html for help
因此只能使用intel版本转译。
如果使用 Anaconda 来管理包的话可以这样安装。
一、到Oracle的官网上下载对应版本的驱动下载 basic 的即可。
https://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.html二、将驱动解压并放到合适的位置例如放在
/Users/oneuser/apptools/oracle/instantclient_11_2并修改 ~.zsh 这里要适配你所用的Shell有可能是~.bashrc增中一个导出
export DYLD_LIBRARY_PATH/Users/oneuser/apptools/instantclient_11_2/%保存
三、用Anaconda创建一个环境打开一个新的终端输入 CONDA_SUBDIRosx-64 conda create -n pyoraintel python3.9conda activate pyoraintelpip3 install cx_oracle #一定要用 pip3 来安装不要用 conda 来安装用conda来安装会错安装成 arm 版本。