Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 272299

Summary: python does not recognize module from numpy package: ImportError: cannot import name interactive
Product: Gentoo Linux Reporter: lumbrius
Component: [OLD] DevelopmentAssignee: Python Gentoo Team <python>
Status: VERIFIED TEST-REQUEST    
Severity: trivial CC: kernelpanic, sci
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description lumbrius 2009-06-02 17:42:25 UTC
dev-python/numpy-1.3.0 : python interpreter can't find module interactive.py (and possibly others)


vmbrius@vesta ~/workdir/200906att $ ls -l /usr/lib64/python2.6/site-packages/numpy/distutils/ | grep interactive
-rw-r--r-- 1 root root  6145 2009-03-29 15:24 interactive.py
-rw-r--r-- 1 root root  5856 2009-04-21 14:08 interactive.pyc
-rw-r--r-- 1 root root  5856 2009-04-21 14:08 interactive.pyo

Reproducible: Always

Steps to Reproduce:
1. emerge numpy, mathplotlib
2. try to execute:
#!/usr/bin/python

import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.ylabel('some numbers')
plt.show()

Actual Results:  
Traceback (most recent call last):
  File "./math.py", line 3, in <module>
    import matplotlib.pyplot as plt
  File "/usr/lib64/python2.6/site-packages/matplotlib/__init__.py", line 127, in <module>
    import sys, os, tempfile
  File "/usr/lib64/python2.6/tempfile.py", line 34, in <module>
    from random import Random as _Random
  File "/usr/lib64/python2.6/random.py", line 45, in <module>
    from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
  File "/home/vmbrius/science/2009/Phthalocyanines/200906att/math.py", line 3, in <module>
    import matplotlib.pyplot as plt
  File "/usr/lib64/python2.6/site-packages/matplotlib/pyplot.py", line 4, in <module>
    from matplotlib import _pylab_helpers, interactive
ImportError: cannot import name interactive

Expected Results:  
All should work, but it doesn't :p

vmbrius@vesta ~/workdir/200906att $ emerge --info            
Portage 2.2_rc33 (default/linux/amd64/2008.0/desktop, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.28-gentoo-r2 x86_64)
=================================================================                                                
System uname: Linux-2.6.28-gentoo-r2-x86_64-Intel-R-_Core-TM-2_Duo_CPU_P7350_@_2.00GHz-with-gentoo-2.0.1         
Timestamp of tree: Tue, 02 Jun 2009 08:00:01 +0000                                                               
app-shells/bash:     4.0_p24                                                                                     
dev-java/java-config: 2.1.8                                                                                      
dev-lang/python:     2.6.2-r1                                                                                    
dev-util/cmake:      2.6.4                                                                                       
sys-apps/baselayout: 2.0.1                                                                                       
sys-apps/openrc:     0.4.3-r2                                                                                    
sys-apps/sandbox:    1.9                                                                                         
sys-devel/autoconf:  2.13, 2.63-r1                                                                               
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10.2                                                                  
sys-devel/binutils:  2.19.1-r1                                                                                   
sys-devel/gcc-config: 1.4.1                                                                                      
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.2/env /usr/kde/4.2/share/config /usr/kde/4.2/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1"
LINGUAS="ru en_GB"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdr cli cracklib crypt cups dbus dri dvd dvdr dvdread eds emboss encode esd evo fam firefox fortran gdbm gif gnome gpm gstreamer hal iconv isdnlog jpeg kde kdeprefix ldap libnotify mad midi mikmod mmx mp3 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp oss pam pcre pdf perl png ppds pppd python qt3 qt3support qt4 quicktime readline reflection samba sdl session spell spl sse sse2 sse3 ssl startup-notification svg sysfs tcpd tiff truetype unicode usb vorbis xml xorg xulrunner xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en_GB" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sebastian Luther (few) 2009-06-02 19:56:57 UTC
Did you run python-updater?
Comment 2 lumbrius 2009-06-02 20:06:00 UTC
Yes, and it did not help :(
Comment 3 Michelangelo Scopelliti 2009-06-18 14:39:31 UTC
(In reply to comment #2)
> Yes, and it did not help :(
> 

it seems you have pretty much my configuration, but I was not able to reproduce your issue... have you tried to remove older version of python and then a revdep-rebuild?

Comment 4 lumbrius 2009-06-18 18:01:15 UTC
(In reply to comment #3)
 
> it seems you have pretty much my configuration, but I was not able to reproduce
> your issue... have you tried to remove older version of python and then a
> revdep-rebuild?


Yes, I've tried this and I've even tried to install 2.5, unmerge 2.6 and revdep-rebuild, emerge 2.6, unmerge 2.5 and revdep-rebuild - nothing helps :((
Comment 5 S├ębastien Fabbro (RETIRED) gentoo-dev 2009-08-18 17:02:03 UTC
I can't reproduce it either. Is it still a problem?
Comment 6 lumbrius 2009-08-18 19:56:18 UTC
yes :(
Comment 7 S├ębastien Fabbro (RETIRED) gentoo-dev 2009-08-19 05:23:51 UTC
Are you sure you are using the python modules from the system? 
Check your PYTHONPATH env variable and why it takes the math module from 
/home/vmbrius/science/2009/Phthalocyanines/200906att/math.py?
I will close this one since none of us can reproduce it. May be try to clean up your python installations and paths.

Comment 8 lumbrius 2009-08-19 10:20:39 UTC
(In reply to comment #7)
> Are you sure you are using the python modules from the system? 
> Check your PYTHONPATH env variable and why it takes the math module from 
> /home/vmbrius/science/2009/Phthalocyanines/200906att/math.py?
> I will close this one since none of us can reproduce it. May be try to clean up
> your python installations and paths.
> 

PYTHONPATH is undefined and I have no idea how I can clean up my python installation. I can't find nothing about it :(
Comment 9 lumbrius 2009-08-19 19:55:03 UTC
I solved this: my script had name math.py, and python was trying to read this file as math lib :/
I've renamed script file, and now all works.