Python教程

Redhat7.4-Python安装配置cx_Oracle

本文主要是介绍Redhat7.4-Python安装配置cx_Oracle,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

上传必要包文件这里不做赘述。

[zhangsan@test2 ~]$ unzip instantclient-basic-linux.x64-11.2.0.4.0.zip
-bash: unzip: 未找到命令
[zhangsan@test2 ~]$ yum install -y unzip zip
已加载插件:product-id, search-disabled-repos, subscription-manager
[zhangsan@test2 ~]$ su - root
[root@test2 ~]# yum install -y unzip zip
[root@test2 ~]# logout
[zhangsan@test2 ~]$ unzip instantclient-basic-linux.x64-11.2.0.4.0.zip
[zhangsan@test2 ~]$ unzip instantclient-sdk-linux.x64-11.2.0.4.0.zip
[zhangsan@test2 ~]$ cd instantclient_11_2/
[zhangsan@test2 instantclient_11_2]$ ln -s libclntsh.so.11.1 libclntsh.so
[zhangsan@test2 instantclient_11_2]$ cd ..
[zhangsan@test2 ~]$ tar -zxvf cx_Oracle-5.2.1.tar.gz
[zhangsan@test2 ~]$ cd cx_Oracle-5.2.1
[zhangsan@test2 cx_Oracle-5.2.1]$ python setup.py install
[zhangsan@test2 cx_Oracle-5.2.1]$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 170, in <module>
raise DistutilsSetupError("cannot locate an Oracle software " \
distutils.errors.DistutilsSetupError: cannot locate an Oracle software installation
[zhangsan@test2 cx_Oracle-5.2.1]$

[zhangsan@test2 ~]$ vi .bashrc
[zhangsan@test2 ~]$ cat .bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions

#zkm 2022-02-06
export JAVA_HOME=/opt/zhangsan/jdk1.8.0_281
export PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
export LANG=zh_CN.UTF-8
alias h=history

export ORACLE_HOME=/opt/zhangsan/instantclient_11_2
export C_INCLUDE_PATH=/opt/zhangsan/instantclient_11_2/sdk/include
export LD_LIBRARY_PATH=/opt/zhangsan/instantclient_11_2

[zhangsan@test2 ~]$ source .bashrc

这篇关于Redhat7.4-Python安装配置cx_Oracle的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!