Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
616 views
in Technique[技术] by (71.8m points)

linux - Installing Python 2.7 without root

I tried installing Python 2.7 without root on a remote linux machine. I ran the commands

./configure prefix=/  
make install DESTDIR=/xxx/yyy/ 

where /xxx/yyy/ is a directory for which I have read-write access.

I ran into a problem at the end. It said:

building dbm using gdbm INFO: Can't locate Tcl/Tk libs and/or headers

Python build finished, but the necessary bits to build these modules were not found: _tkinter bsddb185 dl imageop sunaudiodev To find the necessary bits, look in setup.py in detect_modules() for the module's name.

running build_scripts running install_lib creating /lib/python2.7 error: could not create '/lib/python2.7': Permission denied

Did I take the correct steps in installing it without root access? (i.e., my configure and make commands?) Can anyone tell me why it would not install properly?

Thanks,
ktm

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I just install python2.7.5 without admin right. I think the command should be:

./configure prefix=/xxx/yyy
make install

and then you should add the path /xxx/yyy/bin in .bashrc as:

PYTHONPATH=/home/songmeixu/python/bin
export PATH=$PYTHONPATH:$PATH

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...