我没有root权限。我已下载cx_Oracle-5.1.2-10g-py26-1.i386.rpm
,我想安装它。如何在没有root权限的情况下安装它?
答案 0 :(得分:3)
嗯,有两种可能性:
如果您已编译了某些内容,我建议使用2选项
答案 1 :(得分:3)
现在开始:我已安装在/home/spatel/cx
[spatel@us04 ~]$ rpm -ivh --root /home/spatel/cx cx_Oracle-5.1-11g-py32-1.i386.rpm --relocate /usr=/home/spatel/cx
Preparing... ########################################### [100%]
1:cx_Oracle ########################################### [100%]
以下是我的模块:
[spatel@us04 ~]$ ls -l ~/cx/lib/python3.2/site-packages/
total 276
-rw-r--r-- 1 spatel spatel 896 Mar 19 2011 cx_Oracle-5.1-py3.2.egg-info
-rwxr-xr-x 1 spatel spatel 273264 Mar 19 2011 cx_Oracle.cpython-32mu.so
设置你的python路径
>>> import sys
>>> sys.path.append("/home/spatel/cx/lib/python3.2/site-packages")
>>> print (sys.path)
['', '/usr/lib64/python24.zip', '/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/lib/python2.4/site-packages', '/home/spatel/cx/lib/python3.2/site-packages']