🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.python
Article #28452

Re: Py2exe i Beatifullsoup

#28452
From: Parasit
Date: Sun, 02 Sep 2012 22:37
41 lines
3377 bytes
W dniu sobota, 1 września 2012 09:40:38 UTC+2 użytkownik krystian...@gmail.com napisał:

> W obu przypadkach importowany moduł powinien zostać dodany automatycznie do exe. Zachęcam do sprawdzenia cx_freeze. Zasada działania podobna do py2exe, ale jest aktywnie rozwijany (jest już nawet wersja dla Pythona 3.3).

Update.
Użyłem cx_freeze, efekt ten sam, tyle że czepia się mechanize zamiast BeautifulSoup.
[code]
c:\poligon\StripSucker> cxfreeze StripSucker.py --target-dir dist --include-modules BeautifulSoup,mechanize
Traceback (most recent call last):
  File "C:\Python27\Scripts\cxfreeze", line 5, in <module>
    main()
  File "C:\Python27\lib\site-packages\cx_Freeze\main.py", line 188, in main
    freezer.Freeze()
  File "C:\Python27\lib\site-packages\cx_Freeze\freezer.py", line 520, in Freeze self._FreezeExecutable(executable)
  File "C:\Python27\lib\site-packages\cx_Freeze\freezer.py", line 134, in _Freez
eExecutable
    finder = self._GetModuleFinder(exe)
  File "C:\Python27\lib\site-packages\cx_Freeze\freezer.py", line 302, in _GetModuleFinder
    finder.IncludeModule(name)
  File "C:\Python27\lib\site-packages\cx_Freeze\finder.py", line 523, in Include
Module namespace = namespace)
  File "C:\Python27\lib\site-packages\cx_Freeze\finder.py", line 271, in _Import
Module
    raise ImportError("No module named %r" % name)
ImportError: No module named 'mechanize'

c:\poligon\StripSucker> easy_install mechanize
Searching for mechanize
Best match: mechanize 0.2.5
Processing mechanize-0.2.5-py2.7.egg
mechanize 0.2.5 is already the active version in easy-install.pth

Using c:\python27\lib\site-packages\mechanize-0.2.5-py2.7.egg
Processing dependencies for mechanize
Finished processing dependencies for mechanize
[/code]

Próby użycia setup.py kończą się dokładnie tak samo, albo dodam mechanize do "include" i dostaje zamiast exe:
ImportError: No module named 'mechanize'

Albo nie dopisuje do include i dostaje exe, ale przy próbie uruchomienia jest ten sam błąd.
Technical Details
Message-ID: <9c066311-b323-4f20-8b08-bd7afd03fc5d@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin3!goblin.stu.neva.ru!news.ripco.com!news.glorb.com!b19no393693qas.0!news-out.google.com!da15ni7637554qab.0!nntp.google.com!b19no393692qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <e8a02bd3-fd6b-44dc-b851-34d3ed578e09@googlegroups.com> <b1a83771-716c-415a-96a7-51a95cbeb7a3@googlegroups.com>

Show Full Headers
Complete Article Headers
Received: by 10.224.39.75 with SMTP id f11mr7807043qae.8.1346625424478;        Sun, 02 Sep 2012 15:37:04 -0700 (PDT)
Received: by 10.52.91.47 with SMTP id cb15mr1966728vdb.11.1346625424457; Sun, 02 Sep 2012 15:37:04 -0700 (PDT)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin3!goblin.stu.neva.ru!news.ripco.com!news.glorb.com!b19no393693qas.0!news-out.google.com!da15ni7637554qab.0!nntp.google.com!b19no393692qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.lang.python
Date: Sun, 2 Sep 2012 15:37:04 -0700 (PDT)
In-Reply-To: <b1a83771-716c-415a-96a7-51a95cbeb7a3@googlegroups.com>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=89.72.230.211; posting-account=F-Uu9AoAAABBTRx9iI2VGouvU9hopdo9
NNTP-Posting-Host: 89.72.230.211
References: <e8a02bd3-fd6b-44dc-b851-34d3ed578e09@googlegroups.com> <b1a83771-716c-415a-96a7-51a95cbeb7a3@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9c066311-b323-4f20-8b08-bd7afd03fc5d@googlegroups.com>
Subject: Re: Py2exe i Beatifullsoup
From: Parasit <bartosz.bubak@gmail.com>
Injection-Date: Sun, 02 Sep 2012 22:37:04 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit