Easy Way To Upgrade From Default Python 2.4 To Python 2.7
Table of Contents
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.
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.
- mkdir tmp (you can change "tmp" to whatever you what. its just a folder name)
- cd tmp
- wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
tar jxf Python-2.7.3.tar.bz2- ./configure If you get the following error:
- make
- make altinstall prefix=/tmp/python2.7.3
- cd /tmp
- ln -s /tmp/python2.7.3 /tmp/python2.7
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- 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
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