Home / نصب پایتون نسخه ۲.۷ و ۳.۳ روی RHEL ورژن 6.2

نصب پایتون نسخه ۲.۷ و ۳.۳ روی RHEL ورژن 6.2


# yum groupinstall "Development tools"
# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel

Download and install Python 2.7.3

# wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
# tar xf Python-2.7.3.tar.bz2
# cd Python-2.7.3
# ./configure --prefix=/usr/local
اگر میخوای mod_wsgi  رو نصب کنی
# ./configure --prefix=/usr/local --enable-shared
# make && make altinstall

Download and install Python 3.3.0

# wget http://python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2
# tar xf Python-3.3.0.tar.bz2
# cd Python-3.3.0
# ./configure --prefix=/usr/local
# make && make altinstall

Download and install Distribute for Python 2.7

# wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.35.tar.gz
# tar xf distribute-0.6.35.tar.gz
# cd distribute-0.6.35
# python2.7 setup.py install

This generates the script /usr/local/bin/easy_install-2.7 that you use to install packages for Python 2.7. It puts your packages in /usr/local/lib/python2.7/site-packages/.

Download and install Distribute for Python 3.3

# wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.35.tar.gz
# tar xf distribute-0.6.35.tar.gz
# cd distribute-0.6.35
# python3.3 setup.py install

This generates the script /usr/local/bin/easy_install-3.3 that you use to install packages for Python 3.3. It puts your packages in /usr/local/lib/python3.3/site-packages/.

.

Install and use virtualenv for Python 2.7

# easy_install-2.7 virtualenv
# virtualenv-2.7 --distribute someproject
New python executable in someproject/bin/python2.7
Also creating executable in someproject/bin/python
Installing distribute...................done.
Installing pip................done.
# source someproject/bin/activate
(someproject)# python --version
Python 2.7.3
(someproject)#

Install and use virtualenv for Python 3.3

# easy_install-3.3 virtualenv
# virtualenv-3.3 --distribute otherproject
New python executable in otherproject/bin/python3.3
Also creating executable in otherproject/bin/python
Installing distribute...................done.
Installing pip................done.
# source otherproject/bin/activate
(otherproject)# python --version
Python 3.3.0
(otherproject)#



     RSS of this page