2

Running an exe compiled in py2exe is now giving me this error:

C:\Users\digiholic\git\universalSmashSystem\main.exe\zipextimporter.py:82: RuntimeWarning: import display: No module named _view
(ImportError: No module named _view)
C:\Users\digiholic\git\universalSmashSystem\main.exe\zipextimporter.py:82: RuntimeWarning: import draw: No module named _view
(ImportError: No module named _view)
C:\Users\digiholic\git\universalSmashSystem\main.exe\zipextimporter.py:82: RuntimeWarning: import image: No module named _view
(ImportError: No module named _view)
C:\Users\digiholic\git\universalSmashSystem\main.exe\zipextimporter.py:82: RuntimeWarning: import pixelcopy: No module named _view
(ImportError: No module named _view)
C:\Users\digiholic\git\universalSmashSystem\main.exe\zipextimporter.py:82: RuntimeWarning: import transform: No module named _view
(ImportError: No module named _view)

I did not modify my py2exe file since the last working build, nor have I made any significant changes to my Python installation. I have modified code, which must be causing this issue, but the error message is giving me no information on how to fix it. What could cause this issue?

I have put import pygame._view at the top of my main.py script and it is not helping. I do not reference any system fonts, all fonts used in my code are .ttf files in my package.

EDIT: Searched more. import re is not working either.

Matthew Fournier
  • 1,077
  • 2
  • 17
  • 32
  • I have attempted to recompile an older, working build and am getting the same error. I have concluded the error is something to do with my python modules. What could be causing this? – Matthew Fournier Apr 05 '16 at 17:17
  • Can you elaborate on "nor have I made any significant changes to my Python installation"? – Tom Myddeltyn Apr 15 '16 at 13:02
  • By "No significant changes", I mean I haven't changed Python versions or modified my path since the last time it was working. I have updated my pygame to 1.9.2, but I have tested on 1.9.1 again, and the error persists. – Matthew Fournier Apr 15 '16 at 17:28

2 Answers2

1

The solution is to add import pygame._view to the top of your main source file. Any of the packagers should work after that.

Try to do so. Some similar question was already asked in the past.

Please check also Pygame to exe display module error [duplicate] and Opening an EXE of my Pygame program gives me import errors

IF you look at the second answer the problem was in the "font" usage. Maybe you did something similar :-) Try it out and let us know.

Unfortunately I am not personally using pygame module :-( but I guess for the defined _view you have to use the import as you did correctly :-)

Hope this solve your query :-) Have a nice day.

Community
  • 1
  • 1
Marco smdm
  • 1,020
  • 1
  • 15
  • 25
  • As mentioned in my first post, I have added the import to every file, and it has not helped. I am not using sysfont. I've looked at that question and it did not help at all. – Matthew Fournier Apr 20 '16 at 08:04
1

This is looking like a PYTHONPATH issue. You need to verify that all of the locations where these modules are located are either in the development directory itself or in your search path for Python.

You can do a:

print sys.path

to see what is in your search path and validate those modules are in it. It is possible something changed it. Once you verify that, you can add the missing paths using PYTHONPATH.

Drahkar
  • 1,694
  • 13
  • 17