python环境变量路径linux_linux下python安装到指定目录_linux下无root 安装activepython到指定目录...

本文详细介绍了如何在Linux系统中,以非root用户身份安装ActivePython。首先下载ActivePython安装包,然后切换到非root用户并解压。接着通过运行`install.sh`脚本,使用`-I`参数指定安装目录。最后,添加环境变量到用户的`.bash_profile`文件中以完成安装。整个过程无需root权限,方便用户自定义安装路径。
摘要由CSDN通过智能技术生成

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值