2009/02/13

Ubuntu 8.10下如何升级eric4-python到4.3.0

没有评论:
Ubuntu下的python IDE 软件:
gedit虽然已经很好了,可还是想要一个集成开发环境。ubuntu下的
Eric python IDE 似乎还行。
Stani's Python Editor: another choice 还行,但不能 create project.
PyPE : not good
vim 但没有集成环境
sudo apt-get install vim-full vim-python
最终选用 Eric Python Editor
升级ubuntu from 8.04 to 8.10后,发现eric-python 不再能 auto python code completion (出现提示窗口,但不能选择!)。

解决方案: 重新安装eric4-4.3.0

0. uninstall previous eric4.1.0 from synaptic

1. download eric4 package from http://eric-ide.python-projects.org/eric4-download.html

2. sudo apt-get install python-qt4-dev python-qscintilla2

3. cd to eric-package directory
sudo python install.py
若提示:
Please enter the name of the Qt data directory.
(That is the one containing the 'qsci' subdirectory.)
>>
输入 /usr/share/qt4

4. 运行.
目前ubuntu source 未包含最新eric版本,因此在terminal 执行eric4 (位于/usr/local/bin/eric4)

Note: 目前eric4.3在laptop上窗口显示有问题。

2009/02/06

安装Ubuntu 8.10 带来的问题

没有评论:
Ubuntu 8.10: firefox中flash无声音
解决: sudo apt-get install flashplugin-nonfree-extrasound

启动我的python程序,多了如下两个bugs. :-(

/usr/lib/python2.5/site-packages/pytz/__init__.py:29: UserWarning: Module _mysql was already imported from /var/lib/python-support/python2.5/_mysql.so, but /var/lib/python-support/python2.5 is being added to sys.path
from pkg_resources import resource_stream

import MySQLdb
import matplotlib
会出现 UserWarning, 但顺序
import matplotlib
import MySQLdb
则不会

解释: matplotlib may import mySQLdb and a warning message is issued if mySQLdb already is imported.
而 /usr/lib/python2.5/site-packages/pytz has to do with timezones. python-tz ( pytz: python time zone)

解决方法:
1。 简易。 调整 import 顺序.
2. or look into
/usr/lib/python2.5/site-packages/pytz/__init__.py:29
找到 pkg_resources.py, 修改该文件。
/usr/lib/python2.5/site-packages/pkg_resources.py, Line 2272:

From:
if fn and normalize_path(fn).startswith(loc):
To:
if fn and (fn.startswith(loc) or normalize_path(fn).startswith(loc)):

the warning goes away.




/usr/lib/python2.5/site-packages/pytz/__init__.py:29: UserWarning: Module dateutil was already imported from /var/lib/python-support/python2.5/dateutil/__init__.py, but /var/lib/python-support/python2.5 is being added to sys.path
from pkg_resources import resource_stream

这个好像与 旧的pyc文件没有 update有关,It may be caused by outdated *.pyc files. Can try (sudo python -c 'import dateutil') - that should regenerate
outdated *.pyc files. 第二个warning消失.


/usr/lib/python2.5/site-packages/CGAL/__init__.py:3: RuntimeWarning: Python C API version mismatch for module Kernel: This Python has API version 1013, module Kernel has version 1012.
from Kernel import *
/usr/lib/python2.5/site-packages/CGAL/__init__.py:4: RuntimeWarning: Python C API version mismatch for module Triangulations_2: This Python has API version 1013, module Triangulations_2 has version 1012.
from Triangulations_2 import *
/usr/lib/python2.5/site-packages/CGAL/__init__.py:5: RuntimeWarning: Python C API version mismatch for module Triangulations_3: This Python has API version 1013, module Triangulations_3 has version 1012.
from Triangulations_3 import *

这个与 CGAL 版本落后有关, 按 cgal-python version = 0.9.3 ,python=2.5 重新自己编译. OK. (参见 cgal-python安装)


当然 Ubuntu 8.10也带来一个pylab/matplotlib的好处: pylab绘图完成后会将控制权返回,因此可以在一个canvas上interactive plotting. 以前必须关闭canvas返回。