alejandroautalan / pygubu

A simple GUI builder for the python tkinter module
MIT License
2.01k stars 213 forks source link

Failed to start pygubu-designer #224

Closed JoSchmi closed 3 years ago

JoSchmi commented 3 years ago

Unfortunately I'm not able to start the pygubu designer. Here is what I am using: python: 2.7.14 on win32 (unfortunately I have to use python 2.7) pygubu: 0.10.3 pygubu-designer: 0.11

When I call: python -m pygubudesigner from cmd I get the following error: File "C:\Prog\Python2714\ArcGIS10.6\lib\runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "C:\Prog\Python2714\ArcGIS10.6\lib\runpy.py", line 72, in _run_code exec code in run_globals File "C:\Prog\Python2714\ArcGIS10.6\lib\site-packages\pygubudesigner__main.py", line 5, in main.start_pygubu() File "C:\Prog\Python2714\ArcGIS10.6\lib\site-packages\pygubudesigner\main.py", line 650, in start_pygubu app = PygubuDesigner() File "C:\Prog\Python2714\ArcGIS10.6\lib\site-packages\pygubudesigner\main.py", line 152, in init__ self.mainwindow = self.builder.get_object('mainwindow') File "C:\Prog\Python2714\ArcGIS10.6\lib\site-packages\pygubu\builder__init.py", line 164, in get_object bobject = self._realize(root, wmeta) File "C:\Prog\Python2714\ArcGIS10.6\lib\site-packages\pygubu\builder\init__.py", line 205, in _realize parent.realize(master) File "C:\Prog\Python2714\ArcGIS10.6\lib\site-packages\pygubu\builder\tkstdwidgets.py", line 44, in realize if master is None and tk._default_root is None: AttributeError: 'module' object has no attribute '_default_root'

When I try to run the .\Scripts\pygubu-designer.exe - File nothing happens.

Am I missing something?

Thanks for your feedback.

alejandroautalan commented 3 years ago

Hello JoSchmi, thanks for trying pygubu. Sorry for the late response.

File "C:\Prog\Python2714\ArcGIS10.6\lib\site-packages\pygubudesigner\main.py", line 650, in start_pygubu

That doesn't seem to be a standard python installation, how did you installed pygubu-designer? What is ArcGIS ? It can be downloaded?, so I can test it with pygubu?

I downloaded standard python 2.7.14 32 bits on windows and works ok. I think pygubu is having problems with the ArcGis system you have installed. Let me know.

Regards Alejandro A.

JoSchmi commented 3 years ago

Hello Alejandro

Thanks for your response. I installed pygubu on a virtual environment and it worked. So we can close this issue as it has most probably something to do with my python installation. ArcGIS by the way is a GIS-Software with integrated python to do some script based geoprocessing.

Thanks again for your effort on pygubu!

JoSchmi commented 3 years ago

Although this is a closed issue, I wanted you to know that I was able to reproduce the error. It seems to be a problem with a site-package 'tkinter' found here: C:\Prog\Python2714\ArcGIS10.6\Lib\site-packages\tkinter

As soon as I rename the site-package, pygubu is running as expected. I actually don't know what this site-package is used for. It just seems to make a version independent import of some of the widgets (colorchooser, commondialog, dialog, filedialog, font, messagebox, scrolledtext, tix, ttk). The code is basically the same for every module.

For example the module colorchooser.py contains: from future import absolute_import from future.utils import PY3 if PY3: from tkinter.colorchooser import else: try: from tkColorChooser import except ImportError: raise ImportError('The tkColorChooser module is missing. Does your Py2 ' 'installation include tkinter?')

Do you know, what these site-package is used for? It does not seem Tkinter needs this to run. Unfortunately my research on the internet has not been very successfull on this matter. I am unsure wether it is safe to just delete the site-package to make pygubu run.

Thanks for your feedback.