Domanda

I have been making a game with Python and Pygame, and I've FINALLY finished it! It has a main.py, and this uses 2 other .py files: process.py and classes.py. I have been trying to make it into a standalone .exe (using this setup.py: http://www.pygame.org/wiki/Pygame2exe) but have encountered several difficulties. I used Python 2.6 before, but that gave me two errors. I have just tried 2.7, but I encountered these errors:

C:\Users\Me\Desktop\dist\setup.exe\zipextimporter.py:82: RuntimeWarning: import display: No module named _view
(ImportError: No module named _view)
C:\Users\Me\Desktop\dist\setup.exe\zipextimporter.py:82: RuntimeWarning: import draw: No module named _view
(ImportError: No module named _view)
C:\Users\Me\Desktop\dist\setup.exe\zipextimporter.py:82: RuntimeWarning: import image: No module named _view
(ImportError: No module named _view)
C:\Users\Me\Desktop\dist\setup.exe\zipextimporter.py:82: RuntimeWarning: import pixelcopy: No module named _view
(ImportError: No module named _view)
C:\Users\Me\Desktop\dist\setup.exe\zipextimporter.py:82: RuntimeWarning: import transform: No module named _view
(ImportError: No module named _view)
C:\Users\Me\Desktop\dist\setup.exe\distutils\dist.py:267: UserWarning: Unknown distribution option: 'dist_dir'
error: invalid command 'bdist'

Can anyone help me? I need to fix ALL of these errors! The error that has always appeared is the 'dist_dir' error, and I cannot find a suitable solution for this! I have installed SetupTools for 2.7 and it still comes up, despite being told this would fix it. This is the error that I need to fix the most, so if you only have an appropriate solution for this, that is fine. Thank you!

È stato utile?

Soluzione

To answer the first lines of errors add this to your code:

import pygame._view

The last line error is probably with your code. Please post the complete code from your game. Try the first fix and then see if the application runs. Good luck!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top