TkinterMapView
TkinterMapView copied to clipboard
problem in an async tkinter app 'PhotoImage' object has no attribute '_PhotoImage__photo'
I exactly followed your example codes but not working inside my async Tkinter app... you example files works fine but don't working inside my app... is there a compatibility problem with async_tkinter_loop?
This is how I add your widget just after my other widgets
map_widget = tkintermapview.TkinterMapView(root, width=200, height=200, corner_radius=0) map_widget.pack() map_widget.set_position(48.860381, 2.338594) # Paris, France map_widget.set_zoom(15)
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/ImageTk.py", line 146, in del name = self.__photo.name AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo' Exception ignored in: <function PhotoImage.del at 0x7f831923b0e0> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/ImageTk.py", line 146, in del name = self.__photo.name AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo' Exception ignored in: <function PhotoImage.del at 0x7f831923b0e0> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/ImageTk.py", line 146, in del name = self.__photo.name AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo' Exception ignored in: <function PhotoImage.del at 0x7f831923b0e0> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/ImageTk.py", line 146, in del name = self.__photo.name AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo' Exception ignored in: <function PhotoImage.del at 0x7f831923b0e0> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/ImageTk.py", line 146, in del name = self.__photo.name AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo' Exception ignored in: <function PhotoImage.del at 0x7f831923b0e0> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/ImageTk.py", line 146, in del name = self.__photo.name AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo' Exception ignored in: <function PhotoImage.del at 0x7f831923b0e0> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/ImageTk.py", line 146, in del name = self.__photo.name AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo' Exception ignored in: <function PhotoImage.del at 0x7f831923b0e0> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/ImageTk.py", line 146, in del name = self.__photo.name AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo' Exception ignored in: <function PhotoImage.del at 0x7f831923b0e0> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/ImageTk.py", line 146, in del name = self.__photo.name AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo' Exception ignored in: <function PhotoImage.del at 0x7f831923b0e0> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/ImageTk.py", line 146, in del name = self.__photo.name AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo'
Can you post a full example? I have never used async with tkinter and I don't know what you are doing...
Can you post a complete example? I have never used async with Tkinter and I don't know what you are doing...
This might not be the best optimum code, actually my first python experience :) But this program completely works OK. Only mapview doesn't work as expected.
I attached the code... gc1.py.zip
any update on this issue? I still have this problem
I have the same problem
This was happening to me every time I close the tkinter window with just the example code from the README, no async involved, but it was fixed once i wrapped the "root_tk.mainloop()" call in the "if name == 'main'" structure. I think there are some async elements in the backend of this library that get detached from the main thread if you close the window or if you have other async elements in your program, so try messing around with the thread management in your code to see if this gets resolved.
I had this problem when there was time consuming code between root_tk = tkinter.Tk()
and root_tk.mainloop()
. I was able to solve it by relocating the time consuming code.