When I try to build an exe using py2exe, it builds but when i try to run the exe it throws this error:
Traceback (most recent call last):
File "main.py", line 4, in <module>
File "OpenGL\GL\__init__.pyc", line 3, in <module>
File "OpenGL\GL\VERSION\GL_1_1.pyc", line 10, in <module>
File "OpenGL\platform\__init__.pyc", line 35, in <module>
File "OpenGL\platform\__init__.pyc", line 26, in _load
File "OpenGL\plugins.pyc", line 14, in load
File "OpenGL\plugins.pyc", line 28, in importByName
ImportError: No module named win32
It only does this when I use pyopengl, It builds and runs perfectly with pygame and almost any other library/module I have used.
My setup.py script looks like this:
from distutils.core import setup
import py2exe
setup(console=['main.py'])
I am on Windows 7 64bit
Actually, After another hour or so of searching I found the solution!
For anyone else who has this problem: http://www.py2exe.org/index.cgi/PyOpenGL
Related
Have a compiled app that fails when multiarray attempts to import py31compat. It runs fine from source.
I am using Anaconda2-4.4.0-Windowsx86_64.exe (windows 7)
Using numpy-1.12.1, which was installed with pip
Compiling with py2exe script.
The error it gives is:
Traceback (most recent call last):
File "AutoFastener.py", line 23, in <module>
File "BatchControl\modBatchController.pyo", line 94, in <module>
File "FastenerDataSetUtilities\modFDDUtils.pyo", line 21, in <module>
File "scipy\__init__.pyo", line 61, in <module>
File "numpy\__init__.pyo", line 180, in <module>
File "numpy\add_newdocs.pyo", line 13, in <module>
File "numpy\lib\__init__.pyo", line 8, in <module>
File "numpy\lib\type_check.pyo", line 11, in <module>
File "numpy\core\__init__.pyo", line 23, in <module>
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
cannot import name py31compat
I've tried upgrading setuptools and distribute with pip, which did not help.
I've looked in the executables LIB file, and the pkg_resources has py31compat.pyo in it, which as far as I've been able to determine is where it should be.
I don't know how to figure out where the multiarray.pyd is trying to load it from.
I'm trying to make an exe file using py2exe. The problem is that when I try to run created exe file, it returns that it cannot import name chardet.
Traceback (most recent call last):
File "orsr_parser.py", line 10, in <module>
File "requests\__init__.pyc", line 58, in <module>
File "requests\utils.pyc", line 26, in <module>
File "requests\compat.pyc", line 7, in <module>
ImportError: cannot import name chardet
I use requests module in one of the py files in the program.
Setup.py:
from distutils.core import setup
import py2exe
packages = ['requests']
setup(console=['my_script.py'])
Do you know where could be the problem? Is there something with setup.py file?
EDIT: There is only one answer for this problem: Stackoverflow answer, but I probably don't get it. There is no directory called requests in my project.
I have PyInstaller and pykeyboard on my computer. I am trying to create a helpful python program and compile it in to a Linux executable with PyInstaller.
Every time I do this, so long as pykeyboard is imported in the script, it creates the executable, but the executable does not run. It comes back with an error.
I've tried compiling my script without pykeyboard and it works, but I would really like to use pykeyboard and get past this error.
Error shown below.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/root/Desktop/Python/Modules/PyInstaller/PyInstaller-2.1/PyInstaller/loader/pyi_importers.py", line 270, in load_module
File "/home/abigor/Desktop/Scripting/Python/Modules/PyInstaller/PyInstaller-2.1/test/build/test/out00-PYZ.pyz/pykeyboard", line 37, in <module>
File "/root/Desktop/Python/Modules/PyInstaller/PyInstaller-2.1/PyInstaller/loader/pyi_importers.py", line 270, in load_module
File "/home/abigor/Desktop/Scripting/Python/Modules/PyInstaller/PyInstaller-2.1/test/build/test/out00-PYZ.pyz/pykeyboard.x11", line 21, in <module>
File "/root/Desktop/Python/Modules/PyInstaller/PyInstaller-2.1/PyInstaller/loader/pyi_importers.py", line 270, in load_module
File "/home/abigor/Desktop/Scripting/Python/Modules/PyInstaller/PyInstaller-2.1/test/build/test/out00-PYZ.pyz/Xlib.XK", line 63, in <module>
File "/home/abigor/Desktop/Scripting/Python/Modules/PyInstaller/PyInstaller-2.1/test/build/test/out00-PYZ.pyz/Xlib.XK", line 44, in load_keysym_group
ImportError: No module named keysymdef.miscellany
I should also note that the pykeyboard module for Python is actually named "PyUserInput", but to import it from Python you must import "pykeyboard". I forgot to mention that earlier.
I'm trying to freeze application written in python (PySide), Qt. I'm using LMDE, and in Windows application runs, but have problems with Linux.
When I try it at another computer with same version of Mint Debian it doesn't start, and when I try to start it in terminal, it pops:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze/initscripts/Console.py", line 27, in <module>
File "start.py", line 3, in <module>
File "/home/alexdeb/Desktop/AlexW/EXE_Start.py", line 9, in <module>
File "ExtensionLoader_PySide_QtCore.py", line 11, in <module>
ImportError: libpyside-python2.7.so.1.1: cannot open shared object file: No such file or directory
Any help, please?
Run the application using strace to find out which object file it's trying to load
I am trying to compile a python script for visualization of protein molecules using py2exe module. I've python2.7 running in win7 x64. When I try to execute the compiled file, it gives this error:-
C:\Python27\dist>visualn.exe
Traceback (most recent call last):
File "visualn.py", line 19, in <module>
File "MMTK\__init__.pyc", line 39, in <module>
File "Scientific\Geometry\__init__.pyc", line 30, in <module>
File "Scientific\Geometry\VectorModule.pyc", line 9, in <module>
File "Scientific\N.pyc", line 1, in <module>
ImportError: No module named Scientific_numerics_package_id
Without compiling I can run the script successfully. I've already installed scientific,MMTK modules. I got somewhere in the internet that Scientific_numerics_package_id module is available in netCDF4, so I installed that also but no good.
Any idea about the error?
You need the python-netcdf package.