码迷,mamicode.com
首页 > 数据库 > 详细

安装cx_Oracle时报错:error: command 'gcc' failed with exit status 1

时间:2016-09-23 21:55:36      阅读:1133      评论:0      收藏:0      [点我收藏+]

标签:cx_oracle   python   

1、安装cx_Oracle

1)下载cx_Oracle,https://pypi.python.org/pypi

2)解压压缩包

3)执行python setup.py install


执行后报错:error: command ‘gcc‘ failed with exit status 1


排查:

1)检查是否安装oracle客户端软件

2)查看当前环境变量中是否配置oracle的相关变量,如echo $ORACLE_HOME

3)如果没有配置需要将oracle环境变量配置到当前用户.bash_profile中,或/etc/profile中


# cat .bash_profile 

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1

export ORACLE_SID=icpdb

export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin

export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

export ORACLE_TERM=xterm

export TNS_ADMIN=$ORACLE_HOME/network/admin

export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

export CLASSPATH=$ORACLE_HOME/JRE

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

export THREADS_FLAG=native

export DISPLAY=192.168.196.5:0.0

export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"


安装cx_Oracle时报错:error: command 'gcc' failed with exit status 1

标签:cx_oracle   python   

原文地址:http://renee.blog.51cto.com/6859189/1855825

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!