当前位置: 首页 > 工具软件 > ActivePython > 使用案例 >

linux下python安装到指定目录_linux下无root 安装activepython到指定目录

颜均
2023-12-01

linux下无root 安装activepython

1、下载ActivePython-2.7.8.10-linux-x86_64.tar.gz 包

2、进入非root用户,如bdc用户,解压

[bdc@svr001 python]$ tar  -zxvf  ActivePython-2.7.8.10-linux-x86_64.tar.gz

解压得到ActivePython-2.7.8.10-linux-x86_64 目录

3、进入ActivePython-2.7.8.10-linux-x86_64目录

[bdc@svr001 python]$ cd ActivePython-2.7.8.10-linux-x86_64

[bdc@svr001

ActivePython-2.7.8.10-linux-x86_64]$ ll

总用量 52

drwxrwxr-x. 7 bdc bdc

4096  7月  3 2014 INSTALLDIR

-rw-rw-r--. 1 bdc bdc 14306  7月  3 2014

_install.py

-rwxr-xr-x. 1 bdc bdc   373  7月  3 2014 install.sh

-rwxrwxr-x.

1 bdc bdc 16060  7月  3 2014 sh2.py

-rw-rw-r--. 1 bdc bdc 10229  1月 24 13:18

sh2.pyc

4、查看_install.py 文件

[bdc@svr001 ActivePython-2.7.8.10-linux-x86_64]$ more

_install.py

#!/usr/bin/env python

# Copyright (c) 2003-2014 ActiveState

Software Inc.

#

#********************************************************************

#

WARNING: Do not run this script directly. Run the main

"./install.sh"

#          which will launch this script

properly.

#********************************************************************

"""

./install.sh - ActivePython install

script

Usage:

./install.sh

[options...]

General Options:

-h, --help          print

this help and exit

-v, --verbose       verbose output

-I, --install-dir

directory

When called without arguments this script will

interactively install

ActivePython. If the install dir is specified then

ActivePython will

be installed without

interaction.

5、用 -I 或--install-dir 参数可安装到指定目录

[bdc@svr001 ActivePython-2.7.8.10-linux-x86_64]$ ./install.sh  -I

/opt/aspire/product/bdc/python/python27.8.10

Installing ActivePython to

'/opt/aspire/product/bdc/python/python27.8.10'...

Relocating dir-dependent

files...

Pre-compiling .py files in the standard library...

ActivePython has been successfully installed to:

/opt/aspire/product/bdc/python/python27.8.10

You can add the

following to your .bashrc (or equivalent)

to put ActivePython on your

PATH:

export PATH=/opt/aspire/product/bdc/python/python27.8.10/bin:$PATH

The documentation is available here:

/opt/aspire/product/bdc/python/python27.8.10/doc/python2.7/index.html

web: http://docs.activestate.com/activepython/2.7

Please send us any feedback you might have or log bugs here:

Thank you for using ActivePython.

6、加入环境变量

将以下语句加入到bdc用户的 .bash_prorfile环境变量中,并执行..bash_prorfile生效。

export

PATH=/opt/aspire/product/bdc/python/python27.8.10/bin:$PATH

 类似资料: