# [SOLVED] nagstamon

## grzywka18

Wczoraj po uaktualnieniu do wersji 0.9.6.1 nagstamon podczas uruchamiania krzyczy:

```

No module named egg.trayicon

Could not load egg.trayicon, so you cannot put nagstamon statusbar into systray.

Traceback (most recent call last):

  File "/usr/bin/nagstamon", line 45, in <module>

    from Nagstamon import GUI

  File "/usr/lib64/python2.7/site-packages/Nagstamon/GUI.py", line 34, in <module>

    from Nagstamon import Custom # used for initialization of custom components 

  File "/usr/lib64/python2.7/site-packages/Nagstamon/Custom.py", line 9, in <module>

    from Nagstamon.Server.Nagios import NagiosServer

  File "/usr/lib64/python2.7/site-packages/Nagstamon/Server/Nagios.py", line 3, in <module>

    from Nagstamon.Server.Generic import GenericServer

  File "/usr/lib64/python2.7/site-packages/Nagstamon/Server/Generic.py", line 16, in <module>

    from Nagstamon.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup

ImportError: No module named BeautifulSoup

```

```
ortage 2.1.9.42 (default/linux/amd64/10.0/desktop, gcc-4.4.5, libc-0-r0, 2.6.37-gentoo-r4 x86_64)

=================================================================

System uname: Linux-2.6.37-gentoo-r4-x86_64-Intel-R-_Core-TM-2_Duo_CPU_P8400_@_2.26GHz-with-gentoo-2.0.2

Timestamp of tree: Tue, 10 May 2011 02:00:01 +0000

app-shells/bash:     4.1_p9

dev-java/java-config: 2.1.11-r3

dev-lang/python:     2.7.1-r1, 3.1.3-r1

dev-util/cmake:      2.8.4-r1

sys-apps/baselayout: 2.0.2

sys-apps/openrc:     0.8.2-r1

sys-apps/sandbox:    2.4

sys-devel/autoconf:  2.13, 2.65-r1

sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1

sys-devel/binutils:  2.20.1-r1

sys-devel/gcc:       4.4.5

sys-devel/gcc-config: 1.4.1-r1

sys-devel/libtool:   2.2.10

sys-devel/make:      3.81-r2

sys-kernel/linux-headers: 2.6.36.1

sys-libs/glibc:      2.11.3

virtual/os-headers:  0

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="*"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -march=nocona -pipe -mno-tls-direct-seg-refs"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-O2 -march=nocona -pipe -mno-tls-direct-seg-refs"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"

FFLAGS=""

GENTOO_MIRRORS="http://ftp.vectranet.pl/gentoo/ http://gentoo.po.opole.pl "

LANG="pl_PL.UTF-8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LINGUAS="pl"

MAKEOPTS="-j2"

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="/var/lib/layman/sunrise /var/lib/layman/roslin"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X Xaw3d a52 aac acl acpi alsa amd64 apm avi berkdb bluetooth branding bzip2 cairo cdr cgi clamav cli consolekit cracklib crypt ctype cups cxx dbus dovecot-sasl dri dts dvd dvdr emboss encode exif extras fam ffmpeg filter firefox flac fortran gd gdbm gdu gif gnutls gpm gtk hald iconv ipv4 ipv6 ithreads jpeg jpeg2k kde lame lcms ldap libnotify lm_sensore mad madwifi mmx mng modules mp3 mp4 mpeg mplayer mudflap multilib mysql ncurses nls nptl nptlonly nsplugin nss ogg opengl openmp pam pango pcmcia pcre pdf perl pic pl png policykit ppds pppd python python3 qt3support qt4 qt4support readline sdl semantic-desktop session spell sql sse sse2 ssl startup-notification svg sysfs tcpd threads tiff truetype udev unicode usb vorbis webkit wifi wmf x264 xcb xine xml xorg xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" 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 cgi cgid 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" APACHE2_MPMS="peruser" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

robiłem takie rzeczy jak:revdep-rebuild,reinstalacja pythona2.7, python-update i nadal to samo. Czy ktoś się orientuje w czym może być problem ?Last edited by grzywka18 on Wed May 11, 2011 8:04 pm; edited 1 time in total

----------

## lsdudi

```
 emerge dev-python/beautifulsoup 
```

ewentualnia python-updater

----------

## grzywka18

python-updater dawałem wcześniej ale zrobiłem tak:

a) emerge dev-python/beautifulsoup (reinstalacja pakietu)

b) python-updater

i nadal ten sam błąd   :Crying or Very sad: 

----------

## lsdudi

```
eselect python list
```

a pakiet w którym slocie ? bo widziałem że są wersje w na 2 i na 3

```

eix  BeautifulSoup

```

----------

## grzywka18

korzystam z 2.7 ale mam tez 3.1(nie odważyłem się jeszcze przejść) zainstalowane.

Ktoś już to własnie zgłosił http://sourceforge.net/tracker/?func=detail&aid=3299962&group_id=236865&atid=1101370

----------

## Jacekalex

Spora liczba programów działa prawidłowo tylko na pythonie 2.6.*, 2.7 natomiast się sypie , 2.7.* nie jest w pełni zgodny z 2.6.*

Dobrze widać to w najnowszym Ubuntu, w którym po wsadzeniu pythona 2.7.1 pojawiło się tyle błędów, ile dawno nikt w Ubuntu nie widział.

Generalnie przy wersjach języków programowania nie patrzy się wyłącznie na numerki.

Zarówno w pythonie, jak i w perlu czy php znam przypadki, kiedy coś np działało na php-5.2.*, nie działa na php-5.3.*, nawet z gcc jest podobna historia, cpufreqd u mnie kompilowany gcc-4.4.* działał, po skompilowaniu gcc-4.5.* się wywala

```
 cpufreqd -D

*** stack smashing detected ***: cpufreqd - terminated

cpufreqd: stack smashing attack in function <unknown> - terminated

Report to http://bugs.gentoo.org/

Unicestwiony

```

Właśnie dlatego np python , gcc czy  php są w slotach. Radzę na razie trzymać się wersji 2.6.*

EDYTA:

Python2.6 wszyskiego  nie wyjaśnia (choć jest 1 błąd mniej):

```

nagstamon

Traceback (most recent call last):

  File "/usr/bin/nagstamon", line 45, in <module>

    from Nagstamon import GUI

  File "/usr/lib/python2.6/site-packages/Nagstamon/GUI.py", line 34, in <module>

    from Nagstamon import Custom # used for initialization of custom components 

  File "/usr/lib/python2.6/site-packages/Nagstamon/Custom.py", line 9, in <module>

    from Nagstamon.Server.Nagios import NagiosServer

  File "/usr/lib/python2.6/site-packages/Nagstamon/Server/Nagios.py", line 3, in <module>

    from Nagstamon.Server.Generic import GenericServer

  File "/usr/lib/python2.6/site-packages/Nagstamon/Server/Generic.py", line 16, in <module>

    from Nagstamon.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup

ImportError: No module named BeautifulSoup

```

Co ciekawe, moduł BeautifulSoup w pythone jest:

```
 python

Python 2.6.6 (r266:84292, Mar 16 2011, 00:32:03) 

[GCC 4.5.1] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import BeautifulSoup

>>> import egg.trayicon 

>>> 
```

Także to raczej błąd w kodzie programu.

To by było na tyle

 :Cool: 

----------

## lsdudi

```
  File "/usr/lib/python2.6/site-packages/Nagstamon/Server/Generic.py", line 16, in <module> 

    from Nagstamon.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
```

ważne jest skąd jest to importowane:

prawdopodobnie wystarczy zmodyfikować /usr/lib/python2.6/site-packages/Nagstamon/Server/Generic.py

```
 import BeautifulSoup, BeautifulStoneSoup
```

zamiast

```
 from Nagstamon.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
```

----------

## grzywka18

do instalowałem dev-python/egg-python (bardzo dozo niepotrzebnych zależności dla mnie) i podobnie jak Wy miałem

```
Traceback (most recent call last):

  File "/usr/bin/nagstamon", line 45, in <module>

    from Nagstamon import GUI

  File "/usr/lib64/python2.7/site-packages/Nagstamon/GUI.py", line 34, in <module>

    from Nagstamon import Custom # used for initialization of custom components 

  File "/usr/lib64/python2.7/site-packages/Nagstamon/Custom.py", line 9, in <module>

    from Nagstamon.Server.Nagios import NagiosServer

  File "/usr/lib64/python2.7/site-packages/Nagstamon/Server/Nagios.py", line 3, in <module>

    from Nagstamon.Server.Generic import GenericServer

  File "/usr/lib64/python2.7/site-packages/Nagstamon/Server/Generic.py", line 17, in <module>

    import BeautifulStoneSoup

ImportError: No module named BeautifulStoneSoup

```

potem w  pliku /usr/lib64/python2.7/site-packages/Nagstamon/Server/Generic.py zmieniłem na cos takiego:

```

#import BeautifulSoup

#import BeautifulStoneSoup

from BeautifulSoup import BeautifulSoup

from BeautifulSoup import BeautifulStoneSoup

```

i wygląda ze jest ok. Program się uruchomił i działa poprawnie   :Laughing:  Dzięki Wam za pomoc.

----------

