Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have just installed matplotlib to generate some plots. but this module cannot be imported in python interpreter. although it can be imported in ipython, when i use ipython to execute those examples. it didn't show anything...

besides that, i also can't use idle.

 IDLE can't import Tkinter.  Your Python may not be configured for Tk. 

my os is ubuntu 13.04 and the default python version is 3.0. But i install python 2.7 manually.

is there anything wrong with my python configuration.

my python path is

['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']

i just find that only when i start python in terminal, those module cannot be imported!

the sys.path in ipython is

['',
 '/usr/bin',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PILcompat',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol',
 '/usr/lib/python2.7/dist-packages/IPython/extensions']

but after i add those path to PYTHONPATH, it still cannot work.

ImportError: numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS4_AsUnicodeEscapeString

so how can i overwrite the pythonpath??

share|improve this question
1  
FYI the default Python package in Ubuntu 13.04 is still 2.7.4 (try $ python --version). How exactly did you install matplotlib and numpy? –  ali_m Aug 23 '13 at 9:22
    
just used apt-get install... –  Chenglei Wu Aug 24 '13 at 7:26
    
I reinstalled ubuntu 12.04 yesterday... –  Chenglei Wu Aug 24 '13 at 7:29
    
Did you apt-get the python- or the python3- versions of these packages? –  ali_m Aug 24 '13 at 10:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.