Easy Way To Upgrade From Default Python 2.4 To Python 2.7

If you have Linux server with Python 2.4 by default and You want to upgrade it? Here you go.

This an easy way to upgrade from default Python 2.4 to Python 2.7.3. I'm not expert on Linux but this way is works for me and it will not collide with your default Python. To run your bot, you're using python2.7 instead of python.

Now here we go.
Login to server using ssh client like Putty or whatever is. Check python version, if you see 2.4.x then go step above to upgrade.


  1. mkdir tmp (you can change "tmp" to whatever you what. its just a folder name)
  2. cd tmp
  3. wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 
  4. tar jxf Python-2.7.3.tar.bz2 
  5. ./configure
  6. If you get the following error:
    configure: error: no acceptable C compiler found in $PATH
    do this step:
    - yum install gcc tcl tk sqlite-devel readline-devel gdbm-devel
    - yum install tkinter ncurses-devel libdbi-devel tk-devel zlib-devel
    - yum install openssl-devel bzip2-devel

    go to /tmp/Python-2.7.3 directory (cd /tmp/Python-2.7.3) then repeat step 5 again. Wait until finish then go to next step

  7. make
  8. make altinstall prefix=/tmp/python2.7.3
  9. cd /tmp
  10. ln -s /tmp/python2.7.3 /tmp/python2.7
     
Now time to setup bot file. Upload, extract and configure your bot then follow this step to run your bot!!
- screen [enter]
- alias python2.7=/tmp/python2.7/bin/python2.7 [enter]
- python2.7 bot/bot.py [enter]
- close your ssh client
- violaaaaa.....

PS: if get the following error with "yum" like this -bash: yum: command not found, try this;
sudo apt-get update
sudo apt-get install yum rpm

2 Responses to "Easy Way To Upgrade From Default Python 2.4 To Python 2.7"

  1. please help
    i try alot but its same error
    " UnicodeEncodeError: 'ascii' codec can't encode characters in position 8-10: ordinal not in range(128) "
    please this code join chat room please make it to can join arabic room... please


    def handler_admin_join(type, source, parameters):
    if parameters:
    passw = None
    parameters = parameters.split()
    if len(parameters)>1:
    groupchat = parameters[0]+"@conference.nimbuzz.com"
    # passw = string.split(parameters[1], 'pw=', 3)
    # passw = parameters[1].strip('pw=')

    passw = parameters[1]
    else:
    groupchat = parameters[0]+"@conference.nimbuzz.com"
    get_gch_cfg(groupchat)
    for process in STAGE1_INIT:
    with smph:
    INFO['thr'] += 1
    threading.Thread(None,process,'atjoin_init'+str(INFO['thr']),(groupchat,)).start()
    DBPATH="dynamic/"+groupchat+"/config.cfg"
    if GCHCFGS[groupchat].has_key('antikick'):
    pass
    else:
    GCHCFGS[groupchat]['antikick']=1
    write_file(DBPATH, str(GCHCFGS[groupchat]))
    if passw:
    join_groupchat(groupchat, DEFAULT_NICK, passw)
    else:
    join_groupchat(groupchat, DEFAULT_NICK)
    MACROS.load(groupchat)
    reply(type, source, u'join to ' + groupchat)
    else:
    reply(type, source, u'read "help join"')


    i hope help me>>>thanks alot
    alnafei2013@gmail.com

    ReplyDelete
  2. @mahmoud, have you tried to convert your arabic text to another on your chatrooms.list file? This might be work, but I'm not sure :D

    ReplyDelete