I am using ITKPython,
My codes are working well in PyCharm with *.py format but after making a standalone *.exe file via PyInstaller some errors occure as follow:
Traceback (most recent call last):
File “RSG_V_0.py”, line 27, in <module>
File “site-packages\itkExtras.py”, line 449, in imread
File “site-packages\itkLazy.py”, line 40, in getattribute
AttributeError: ‘LazyITKModule’ object has no attribute ‘ImageFileReader’
[29316] Failed to execute script RSG_V_0
Would you please show me the way to solve these kind of problems.
By the way, already I test my PyInstaller with a simple print.py, In fact PyInstaller is working correctly without ITK filters.
Thanks
Sina
That is most likely a problem in PyInstaller. Report it on their issue tracker.
Related
I created an application and bundled it to exe by pyinstaller, however after I tested the exe application, it responded an error message. It seems like my essential api module wasn't imported properly. Please advise, thanks!
ImportError! Could not load api or model class Sheets
Exception in Tkinter callback
Traceback (most recent call last):
File "tkinter\__init__.py", line 1883, in __call__
File "D:\Python Projects\Concept Number Generator\Concept Number Generator.py", line 12, in concept_num
my_sheet=smartsheet_client.Sheets.get_sheet(8743006875477892)
AttributeError: 'str' object has no attribute 'get_sheet'
Based on a search here in Stack Overflow, looks like others have run into this issue in the past. Try importing smartsheet.Sheets -- as described under the heading EDIT 2 in this question: including smartsheet sdk in a bundled app via pyinstaller.
I'm running a python script called ALPS which installs packages. It has worked, but now spits this error:
Traceback (most recent call last):
File "/usr/bin/alps", line 295, in <module>
initPackages()
File "/usr/bin/alps", line 156, in initPackages
packageMap[line.split(':')[0]].append(line.split(':')[1].strip())
KeyError: 'gnome-icon-theme'
The error occured when I made spelling mistake with the package 'gnome-icon-theme?
This is obviously linked to python, but can anyone point the way to solving this? The source code can be found here: https://github.com/FluidIdeas/alps
thanks
Cliff
When I run my py program it works the way I intended it to. If I am on a Linux box and build an executable using Pyinstaller, it builds without issue and executes without issue. I have scoured the Pyinstaller docs, git, etc. none of the posted fixes helped
I am still very new at python and feel like it might be a simple fix and might be over thinking the issue
Why can I no build a functional .exe on a windows based system using pyinstaller?
Windows 10 system
Pyinstaller version 3.2
Python version 3.5.2
This is a GUI program using appJar which is also up to date.
The file does build, but errors "Could not execute script"
EDIT
Not sure if this is best to edit in line like this but...
So studying the output and making adjustments, the issue seems to be appJar.py. For some reason it is missing assets, I am looking into it. The trouble is that I am still not used to looking at this kind of output and am not sure where to start.
C:\Users\_User_>C:\temp\fileCreatorGUI\fileCreatorGUI.exe
Traceback (most recent call last):
File "F:\Users\_User_\python_working\fileCreatorGUI.py", line 73, in <module>
app = gui()
File "C:\Users\_User_\AppData\Local\Programs\Python\Python35\lib\site-packages\appJar\appjar.py", line 509, in __init__
self.topLevel.wm_iconbitmap(self.appJarIcon)
File "C:\Users\_User_\AppData\Local\Programs\Python\Python35\lib\tkinter\__init__.py", line 1716, in wm_iconbitmap
return self.tk.call('wm', 'iconbitmap', self._w, bitmap)
_tkinter.TclError: bitmap "C:\temp\fileCreatorGUI\appJar\resources\icons\favicon.ico" not defined
Failed to execute script fileCreatorGUI
Edit 2
See answer below, but I was barking up the wrong tree on this one,
The Pyinstaller output chokes on the .dll's:
api-ms-win-core-console-l1-1-0.dll
api-ms-win-core-datetime-l1-1-0.dll
(There are like ~40 of these)
I added those .dll's to the python path, I declared them in the bianaries in the .spec file.
here is a truncated log:
2414 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-stdio-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\_USER_NAME\AppData\Local\Programs\Python\Python35-32\lib\site-pa
ckages\PyInstaller\depend\bindepend.py", line 695, in getImports
return _getImports_pe(pth)
File "C:\Users\_USER_NAME\AppData\Local\Programs\Python\Python35-32\lib\site-pa
ckages\PyInstaller\depend\bindepend.py", line 122, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
2423 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-heap-l1-1-0.dll
I tried the fix listed here:
https://github.com/pyinstaller/pyinstaller/pull/1981
but it did not seem to make a difference.
Someone recommended adding the sys.path.insert() route but it did not make a difference either way
I also tried this in a VM with windows 7, clean install, no change. My next step is to try to use Wine in Debian, but I don't really want to go that route. Any help would be appreciated. Thank you
Turns out this was an appJar/packaging issue, the pyinstaller was not looking in the correct directory for the assets. per the dev of appJar, I commented out two lines of code in the appJar.py, lines 508-509:
if self.platform == self.WINDOWS:
self.topLevel.wm_iconbitmap(self.appJarIcon)
More on the specifics here: https://github.com/jarvisteach/appJar/issues/84
I probably can fix this by using the --path argument with pyinstaller but for the moment, the issue is fully resolved
I am having a very odd problem with Python. Whenever I try to use the built-in help function, I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site.py", line 468, in __call__
import pydoc
File "/usr/lib/python2.7/pydoc.py", line 56, in <module>
from repr import Repr
File "repr.py", line 21
def
^
SyntaxError: invalid syntax
I have manually inspected the aforementioned files, but I don't see the error mentioned. I also tried deleting the .pyc files for the files mentioned in the trceback in the /usr/share/python2.7 directory, but I am still having the issue.
My computer is running Ubuntu 12.10 64 bit.
Do you have a file called repr.py in the current directory? That file is incomplete, and shadows the standard library repr module. You can see from the traceback that the file has no full path, only a local path. Rename it or remove it.
Please, do not just delete .pyc files from your system folders, please reinstall python from packages (using your package manager).
Hello
I cannot start running rabbitvcs on openSUSE 11.3 64bit.
I tried to run test.py file which is located in rabbitvcs folder.
It returns the following errors:
jenea#linux-nguv:/usr/lib/python2.6/site-packages/rabbitvcs> python test.py
Traceback (most recent call last):
File "test.py", line 26, in <module>
import lib.helper
File "/usr/lib/python2.6/site-packages/rabbitvcs/lib/__init__.py", line 23, in <module>
from rabbitvcs.lib.log import Log
ImportError: No module named lib.log
PS: I know that is not quite programming question but it seems to me that error occurs because of some paths or settings.
Unfortunately I've no idea where to dig.
Although stupid the answer is the following:
There were two folders where rabbitvcs was intalled. The first was in /usr/lib/rabbitvcs and the second was in /usr/lib64/rabbitvcs. I'm not sure why there was described issue but after I deleted rabbitvcs folder in /usr/lib64 it started to work normally.