Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
I am getting the following error when I try to bundle my
code using py2exe:
File "pyx\__init__.pyc", line 40, in <module>
ImportError: No module named bitmap
My code doesn't write any bitmap files, just .eps files. How can I get
around this issue?
I don't really understand what's going on here (and I have no experience with py2exe whatsoever). However, as far as I can see we're trying to save some lines by __import__ in this __init__.py file py2exe does complain. The file looks like:
__version__ = version.version
__all__ = ["attr", "box", "bitmap", "canvas", "color", "connector", "deco", "deformer", "document",
"epsfile", "graph", "mesh", "path", "pattern", "pdfextra", "style", "trafo", "text", "unit"]
# automatically import main modules into pyx namespace
for module in __all__:
__import__(module, globals(), locals(), )
Instead of the loop with the __import__ expression you should be able to write regular import statements (like the import version at the top). So could you try whether it helps to write it as an import statement? Replace the loop by:
import attr, box, bitmap, canvas, color, connector, deco, deformer, document, epsfile, graph, mesh, path, pattern, pdfextra, style, trafo, text, unit
Note to keep the __all__ list intact as it is responsible to make from pyx import * working as expected.
If it helps you'll find the same issue in a few other __init__.py files (graph, axis, font). You probably need to fix it there too.
Would be great to hear whether this helps.
Am 28.02.2010 um 06:26 schrieb Robert Morden:
> I am getting the following error when I try to bundle my
> code using py2exe:
> File "pyx\__init__.pyc", line 40, in <module>
> ImportError: No module named bitmap
> My code doesn't write any bitmap files, just .eps files. How can I get
> around this issue?
> Take Care
> Keep Smiling
> Rob Morden
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> PyX-user mailing list
by _ _ _ Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim
/ \ \ / ) wobsta@..., http://www.wobsta.de/
/ _ \ \/\/ / PyX - High quality PostScript and PDF figures
(_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/