Pip having problems installing Gooey

Hi. I’ve been trying to install Gooey to run a creality-dwin-lcd-customizer for my 3D Printer, and every time I try to install Gooey via Command Prompt it says the following:


C:\Users\anonymous user>pip install Gooey
Defaulting to user installation because normal site-packages is not writeable
Collecting Gooey
  Using cached Gooey-1.0.8.1-py2.py3-none-any.whl (680 kB)
Collecting pygtrie>=2.3.3
  Using cached pygtrie-2.5.0-py3-none-any.whl (25 kB)
Collecting wxpython>=4.1.0
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Anonymous User\AppData\Local\Temp\pip-install-7qhzvp5s\wxpython_f2a4337f82314ea58ad93ad8ce455f6c\setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "C:\Users\Anonymous User\AppData\Local\Temp\pip-install-7qhzvp5s\wxpython_f2a4337f82314ea58ad93ad8ce455f6c\buildtools\config.py", line 30, in <module>
          from attrdict import AttrDict
      ModuleNotFoundError: No module named 'attrdict'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Please help soon!!

“Just use pip,” they say. “Installing with pip is a breeze.”

My absolute wild guess is that you need to install attrdict before you can install Gooey. Try pip install attrdict first.

wxPython-Phoenix has provided prebuilt wheels for MacOS and Windows 64bit, but not for others. And there is no clear guide on how to build from the source.

You have to attempt-and-fail step by step, installing attrdict would be a good start, but remember to add --no-build-isolation when running pip install.

Successfully installed attrdict, but now it shows this error:

C:\Users\anonymous user>pip install Gooey --no-build-isolation
Defaulting to user installation because normal site-packages is not writeable
Collecting Gooey
  Using cached Gooey-1.0.8.1-py2.py3-none-any.whl (680 kB)
Requirement already satisfied: Pillow>=4.3.0 in c:\users\Anonymous User\appdata\roaming\python\python311\site-packages (from Gooey) (9.3.0)
Requirement already satisfied: psutil>=5.4.2 in c:\users\Anonymous\appdata\roaming\python\python311\site-packages (from Gooey) (5.9.4)
Requirement already satisfied: colored>=1.3.93 in c:\users\Anonymous User\appdata\roaming\python\python311\site-packages (from Gooey) (1.4.4)
Collecting pygtrie>=2.3.3
  Using cached pygtrie-2.5.0-py3-none-any.whl (25 kB)
Collecting wxpython>=4.1.0
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\anche\AppData\Local\Temp\pip-install-he8talii\wxpython_4992b4f2b25a42d885f2a6d1de88f134\setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "C:\Users\Anonymous User\AppData\Local\Temp\pip-install-he8talii\wxpython_4992b4f2b25a42d885f2a6d1de88f134\buildtools\config.py", line 30, in <module>
          from attrdict import AttrDict
        File "C:\Users\Anonymous User\AppData\Roaming\Python\Python311\site-packages\attrdict\__init__.py", line 5, in <module>
          from attrdict.mapping import AttrMap
        File "C:\Users\Anonymous User\AppData\Roaming\Python\Python311\site-packages\attrdict\mapping.py", line 4, in <module>
          from collections import Mapping
      ImportError: cannot import name 'Mapping' from 'collections' (C:\Program Files\Python311\Lib\collections\__init__.py)
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Was I supposed to install attrdict alone with --no-build-isolation, Gooey with --no-build-isolation, or both with --no-build-isolation? Currently I installed both attrdict AND Gooey with --no-build-isolation, but I’ll fiddle around and see which combination works.
Just in case you need the info from the installation of attrdict, here it is:

C:\Users\Anonymous User>pip install attrdict --no-build-isolation
Defaulting to user installation because normal site-packages is not writeable
Collecting attrdict
  Using cached attrdict-2.0.1-py2.py3-none-any.whl (9.9 kB)
Requirement already satisfied: six in c:\users\Anonymous User\appdata\roaming\python\python311\site-packages (from attrdict) (1.16.0)
Installing collected packages: attrdict
Successfully installed attrdict-2.0.1

Hang on, I read the code, and it can’t find that package, which is why it’s giving me that error!!
Installing the packages now and will see if it resolves.

UPDATE: Well, I’ve installed attrdict, cmake, mapping, etc. and I still can’t get it to work. On top of that, I don’t know what, why, when, or where this new error message is or means.

C:\Users\Anonymous User>pip install Gooey
Defaulting to user installation because normal site-packages is not writeable
Collecting Gooey
  Using cached Gooey-1.0.8.1-py2.py3-none-any.whl (680 kB)
Requirement already satisfied: Pillow>=4.3.0 in c:\users\Anonymous User\appdata\roaming\python\python311\site-packages (from Gooey) (9.3.0)
Requirement already satisfied: psutil>=5.4.2 in c:\users\Anonymous User\appdata\roaming\python\python311\site-packages (from Gooey) (5.9.4)
Requirement already satisfied: colored>=1.3.93 in c:\users\Anonymous User\appdata\roaming\python\python311\site-packages (from Gooey) (1.4.4)
Collecting pygtrie>=2.3.3
  Using cached pygtrie-2.5.0-py3-none-any.whl (25 kB)
Collecting wxpython>=4.1.0
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Anonymous User\AppData\Local\Temp\pip-install-n4srccgw\wxpython_85533b686d38405580fc364c9b666e75\setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "C:\Users\Anonymous User\AppData\Local\Temp\pip-install-n4srccgw\wxpython_85533b686d38405580fc364c9b666e75\buildtools\config.py", line 30, in <module>
          from attrdict import AttrDict
        File "C:\Users\Anonymous User\AppData\Roaming\Python\Python311\site-packages\attrdict\__init__.py", line 5, in <module>
          from attrdict.mapping import AttrMap
        File "C:\Users\Anonymous User\AppData\Roaming\Python\Python311\site-packages\attrdict\mapping.py", line 8, in <module>
          from attrdict.mixins import MutableAttr
        File "C:\Users\Anonymous User\AppData\Roaming\Python\Python311\site-packages\attrdict\mixins.py", line 17, in <module>
          class Attr(Mapping):
      TypeError: module() takes at most 2 arguments (3 given)
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I’m going to give up soon and switch to C++, as this is WAY too much work, especially for a “High-Level” programming language.

Okay, the problem is actually from collections import Mapping - for a while this was available from the base collections package, but it’s actually supposed to be imported from collections.abc. In Python 3.10, the old names were removed breaking this package. Looking at the attrdict repo, it’s been abandoned by the author for a while, so wxPython should probably have migrated away from it. Ah, you can pip install attrdict3, which is a fork of the project that works on 3.10+.

Ok, so I installed attrdict3, and requests, and it successfully installed Gooey!! Thank you sooo much!!

1 Like

Hi,

unfortunately over here, I can still not correctly install Gooey. After manually installing attrdict3 and requests, the pip install gooey fails while showing the following error messages:

(project1) c:\Users\user1\_NEXTCLOUD\_TOOLS\_Python\LIB__freeplane>pip install gooey
Collecting gooey
  Using cached Gooey-1.0.8.1-py2.py3-none-any.whl (680 kB)
Requirement already satisfied: Pillow>=4.3.0 in c:\users\user1\project1\lib\site-packages (from gooey) (9.4.0)
Collecting psutil>=5.4.2
  Using cached psutil-5.9.4-cp36-abi3-win_amd64.whl (252 kB)
Collecting colored>=1.3.93
  Using cached colored-1.4.4.tar.gz (36 kB)
  Preparing metadata (setup.py) ... done
Collecting pygtrie>=2.3.3
  Using cached pygtrie-2.5.0-py3-none-any.whl (25 kB)
Collecting wxpython>=4.1.0
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: six in c:\users\user1\project1\lib\site-packages (from wxpython>=4.1.0->gooey) (1.16.0)
Collecting numpy
  Using cached numpy-1.24.2-cp311-cp311-win_amd64.whl (14.8 MB)
Installing collected packages: pygtrie, colored, psutil, numpy, wxpython, gooey
  DEPRECATION: colored is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for colored ... done
  DEPRECATION: wxpython is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for wxpython ... error
  error: subprocess-exited-with-error

  × Running setup.py install for wxpython did not run successfully.
  │ exit code: 1
  ╰─> [49 lines of output]
      C:\Users\user1\project1\Lib\site-packages\setuptools\dist.py:771: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
        warnings.warn(
      C:\Users\user1\project1\Lib\site-packages\setuptools\config\setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      C:\Users\user1\project1\Lib\site-packages\setuptools\dist.py:317: DistDeprecationWarning: use_2to3 is ignored.
        warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
      running install
      C:\Users\user1\project1\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      Will build using: "C:\Users\user1\project1\Scripts\python.exe"
      3.11.1 (tags/v3.11.1:a7a450f, Dec  6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]
      Python's architecture is 64bit
      cfg.VERSION: 4.2.0

      Running command: build
      Running command: build_wx
      Command '"C:\Users\user1\project1\Scripts\python.exe" -c "import os, sys, setuptools.msvc; setuptools.msvc.isfile = lambda path: path is not None and os.path.isfile(path); ei = setuptools.msvc.EnvironmentInfo('x64', vc_min_ver=14.0); env = ei.return_env(); env['vc_ver'] = ei.vc_ver; env['vs_ver'] = ei.vs_ver; env['arch'] = ei.pi.arch; env['py_ver'] = sys.version_info[:2]; print(env)"' failed with exit code 1.
      Traceback (most recent call last):

        File "<string>", line 1, in <module>

        File "C:\Users\user1\project1\Lib\site-packages\setuptools\msvc.py", line 1120, in __init__

          self.si = SystemInfo(self.ri, vc_ver)

                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

        File "C:\Users\user1\project1\Lib\site-packages\setuptools\msvc.py", line 596, in __init__

          vc_ver or self._find_latest_available_vs_ver())

                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

        File "C:\Users\user1\project1\Lib\site-packages\setuptools\msvc.py", line 610, in _find_latest_available_vs_ver

          raise distutils.errors.DistutilsPlatformError(

      distutils.errors.DistutilsPlatformError: No Microsoft Visual C++ version found
      Finished command: build_wx (0.382s)
      Finished command: build (0.382s)
      WARNING: Building this way assumes that all generated files have been
      generated already.  If that is not the case then use build.py directly
      to generate the source and perform the build stage.  You can use
      --skip-build with the bdist_* or install commands to avoid this
      message and the wxWidgets and Phoenix build steps in the future.

      "C:\Users\user1\project1\Scripts\python.exe" -u build.py build
      Command '"C:\Users\user1\project1\Scripts\python.exe" -u build.py build' failed with exit code 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> wxpython

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: python.exe -m pip install --upgrade pip

I was able to get it working and fix the wxpython build issues by doing the following in a clean virtual environment

Step 1
python -m pip install attrdict3 wheel requests
Step 2
python -m pip install gooey

As a reference here are the versions I am using:
python==3.11.0
pip==22.3

attrdict3==2.0.2
wheel==0.40.0
requests==2.30.0

wxpython==4.1.0
gooey==1.0.8.1