Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux Mint 20.3: Installing via pip fails #24

Closed
jeroenst opened this issue Mar 17, 2023 · 10 comments
Closed

Linux Mint 20.3: Installing via pip fails #24

jeroenst opened this issue Mar 17, 2023 · 10 comments

Comments

@jeroenst
Copy link

jeroenst commented Mar 17, 2023

Hi!

I try to use ESP_Flasher but I get an error while installing via pip:

pip install esp-flasher
Defaulting to user installation because normal site-packages is not writeable
Collecting esp-flasher
  Using cached esp_flasher-1.4.1-py3-none-any.whl (111 kB)
Requirement already satisfied: requests<3,>=2.24.0 in /home/jeroen/.local/lib/python3.8/site-packages (from esp-flasher) (2.27.1)
Collecting wxpython<5.0,>=4.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 "/tmp/pip-install-zyftjlzj/wxpython_11e66a7a8d8f422ab83c39fad694ad67/setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "/tmp/pip-install-zyftjlzj/wxpython_11e66a7a8d8f422ab83c39fad694ad67/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.

@Jason2866
Copy link
Owner

Which OS and version?

@jeroenst
Copy link
Author

Linux Mint 20.3 Cinnamon

@jeroenst
Copy link
Author

jeroenst commented Mar 17, 2023

pip3 install attrdict solves this error but now I got this:

pip install esp-flasher
Defaulting to user installation because normal site-packages is not writeable
Collecting esp-flasher
  Using cached esp_flasher-1.4.1-py3-none-any.whl (111 kB)
Requirement already satisfied: requests<3,>=2.24.0 in ./.local/lib/python3.8/site-packages (from esp-flasher) (2.27.1)
Requirement already satisfied: pyserial>=3.5 in ./.local/lib/python3.8/site-packages (from esp-flasher) (3.5)
Collecting wxpython<5.0,>=4.0
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.local/lib/python3.8/site-packages (from requests<3,>=2.24.0->esp-flasher) (1.26.5)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests<3,>=2.24.0->esp-flasher) (2.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in ./.local/lib/python3.8/site-packages (from requests<3,>=2.24.0->esp-flasher) (2.0.12)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests<3,>=2.24.0->esp-flasher) (2019.11.28)
Requirement already satisfied: pillow in /usr/lib/python3/dist-packages (from wxpython<5.0,>=4.0->esp-flasher) (7.0.0)
Requirement already satisfied: six in ./.local/lib/python3.8/site-packages (from wxpython<5.0,>=4.0->esp-flasher) (1.16.0)
Requirement already satisfied: numpy in ./.local/lib/python3.8/site-packages (from wxpython<5.0,>=4.0->esp-flasher) (1.24.2)
Building wheels for collected packages: wxpython
  Building wheel for wxpython (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [142 lines of output]
      running bdist_wheel
      running build
      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.
      
      "/usr/bin/python3" -u build.py build
      Will build using: "/usr/bin/python3"
      3.8.10 (default, Nov 14 2022, 12:59:47)
      [GCC 9.4.0]
      Python's architecture is 64bit
      cfg.VERSION: 4.2.0
      
      Running command: build
      Running command: build_wx
      wxWidgets build options: ['--wxpython', '--unicode', '--gtk3']
      Configure options: ['--enable-unicode', '--with-gtk=3', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-sdl']
      /tmp/pip-install-x1sgfktd/wxpython_b9652ea1547946a393162e6a5fea9a72/ext/wxWidgets/configure --enable-unicode --with-gtk=3 --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-sdl
      checking build system type... x86_64-pc-linux-gnu
      checking host system type... x86_64-pc-linux-gnu
      checking for toolkit... gtk
      checking for gcc... gcc
      checking whether the C compiler works... yes
      checking for C compiler default output file name... a.out
      checking for suffix of executables...
      checking whether we are cross compiling... no
      checking for suffix of object files... o
      checking whether we are using the GNU C compiler... yes
      checking whether gcc accepts -g... yes
      checking for gcc option to accept ISO C89... none needed
      checking whether we are using the Intel C compiler... no
      checking how to run the C preprocessor... gcc -E
      checking for grep that handles long lines and -e... /usr/bin/grep
      checking for egrep... /usr/bin/grep -E
      checking whether gcc needs -traditional... no
      checking for g++... g++
      checking whether we are using the GNU C++ compiler... yes
      checking whether g++ accepts -g... yes
      checking whether we are using the Intel C++ compiler... no
      checking whether we are using the Sun C++ compiler... no
      checking for ar... ar
      checking for ANSI C header files... yes
      checking for sys/types.h... yes
      checking for sys/stat.h... yes
      checking for stdlib.h... yes
      checking for string.h... yes
      checking for memory.h... yes
      checking for strings.h... yes
      checking for inttypes.h... yes
      checking for stdint.h... yes
      checking for unistd.h... yes
      checking for langinfo.h... yes
      checking for wchar.h... yes
      checking for sys/select.h... yes
      checking for cxxabi.h... yes
      checking for an ANSI C-conforming const... yes
      checking for inline... inline
      checking size of short... 2
      checking size of void *... 8
      checking size of int... 4
      checking size of long... 8
      checking size of size_t... 8
      checking size of long long... 8
      checking size of wchar_t... 4
      checking for va_copy... yes
      checking for _FILE_OFFSET_BITS value needed for large files... 64
      checking if large file support is available... yes
      checking for _LARGEFILE_SOURCE value needed for large files... no
      checking whether byte ordering is bigendian... no
      checking for std::wstring in <string>... yes
      checking for std::istream... yes
      checking for std::ostream... yes
      checking for type_traits... yes
      checking for __sync_xxx_and_fetch builtins... yes
      checking for libraries directories... /usr/lib/x86_64-linux-gnu /usr/lib
      checking for cos... no
      checking for floor... no
      checking if floating point functions link without -lm... no
      checking for sin... yes
      checking for ceil... yes
      checking if floating point functions link with -lm... yes
      checking for strtoull... yes
      checking for pkg-config... /usr/bin/pkg-config
      checking pkg-config is at least version 0.9.0... yes
      checking for LIBPCRE... yes
      checking for zlib.h >= 1.1.4... yes
      checking for zlib.h... (cached) yes
      checking for deflate in -lz... yes
      checking for png.h > 0.90... no
      checking for png.h... (cached) no
      configure: WARNING: system png library not found or too old, will use built-in instead
      checking whether png.c file exists... yes
      checking for jpeglib.h... no
      configure: WARNING: system jpeg library not found, will use built-in instead
      checking whether jpeglib.h file exists... yes
      checking for jbg_dec_init in -ljbig... no
      checking for LIBTIFF... not found via pkg-config
      checking for tiffio.h... no
      configure: WARNING: system tiff library not found, will use built-in instead
      checking whether tiff.h file exists... yes
      checking for expat.h... yes
      checking if expat.h is valid C++ header... yes
      checking for XML_ParserCreate in -lexpat... yes
      checking for LIBCURL... not found
      checking for GTK+ version...
      checking for pkg-config... (cached) /usr/bin/pkg-config
      checking pkg-config is at least version 0.16... yes
      checking for GTK+ - version >= 3.0.0... Package gtk+-3.0 was not found in the pkg-config search path.
      Perhaps you should add the directory containing `gtk+-3.0.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'gtk+-3.0' found
      Package gthread-2.0 was not found in the pkg-config search path.
      Perhaps you should add the directory containing `gthread-2.0.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'gthread-2.0' found
      no
      *** Could not run GTK+ test program, checking why...
      *** The test program failed to compile or link. See the file config.log for the
      *** exact error that occurred. This usually means GTK+ is incorrectly installed.
      configure: error:
      The development files for GTK+ were not found. For GTK+ 2, please
      ensure that pkg-config is in the path and that gtk+-2.0.pc is
      installed. For GTK+ 1.2 please check that gtk-config is in the path,
      and that the version is 1.2.3 or above. Also check that the
      libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
      --libs' are in the LD_LIBRARY_PATH or equivalent.
      
      Error running configure
      ERROR: failed building wxWidgets
      Traceback (most recent call last):
        File "build.py", line 1563, in cmd_build_wx
          wxbuild.main(wxDir(), build_options)
        File "/tmp/pip-install-x1sgfktd/wxpython_b9652ea1547946a393162e6a5fea9a72/buildtools/build_wxwidgets.py", line 379, in main
          exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
        File "/tmp/pip-install-x1sgfktd/wxpython_b9652ea1547946a393162e6a5fea9a72/buildtools/build_wxwidgets.py", line 72, in exitIfError
          raise builder.BuildError(msg)
      buildtools.builder.BuildError: Error running configure
      Finished command: build_wx (0m3.747s)
      Finished command: build (0m3.747s)
      Command '"/usr/bin/python3" -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: Failed building wheel for wxpython
  Running setup.py clean for wxpython
Failed to build wxpython
Installing collected packages: wxpython, esp-flasher
  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
  ╰─> [142 lines of output]
      running install
      running build
      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.
      
      "/usr/bin/python3" -u build.py build
      Will build using: "/usr/bin/python3"
      3.8.10 (default, Nov 14 2022, 12:59:47)
      [GCC 9.4.0]
      Python's architecture is 64bit
      cfg.VERSION: 4.2.0
      
      Running command: build
      Running command: build_wx
      wxWidgets build options: ['--wxpython', '--unicode', '--gtk3']
      Configure options: ['--enable-unicode', '--with-gtk=3', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-sdl']
      /tmp/pip-install-x1sgfktd/wxpython_b9652ea1547946a393162e6a5fea9a72/ext/wxWidgets/configure --enable-unicode --with-gtk=3 --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-sdl
      checking build system type... x86_64-pc-linux-gnu
      checking host system type... x86_64-pc-linux-gnu
      checking for toolkit... gtk
      checking for gcc... gcc
      checking whether the C compiler works... yes
      checking for C compiler default output file name... a.out
      checking for suffix of executables...
      checking whether we are cross compiling... no
      checking for suffix of object files... o
      checking whether we are using the GNU C compiler... yes
      checking whether gcc accepts -g... yes
      checking for gcc option to accept ISO C89... none needed
      checking whether we are using the Intel C compiler... no
      checking how to run the C preprocessor... gcc -E
      checking for grep that handles long lines and -e... /usr/bin/grep
      checking for egrep... /usr/bin/grep -E
      checking whether gcc needs -traditional... no
      checking for g++... g++
      checking whether we are using the GNU C++ compiler... yes
      checking whether g++ accepts -g... yes
      checking whether we are using the Intel C++ compiler... no
      checking whether we are using the Sun C++ compiler... no
      checking for ar... ar
      checking for ANSI C header files... yes
      checking for sys/types.h... yes
      checking for sys/stat.h... yes
      checking for stdlib.h... yes
      checking for string.h... yes
      checking for memory.h... yes
      checking for strings.h... yes
      checking for inttypes.h... yes
      checking for stdint.h... yes
      checking for unistd.h... yes
      checking for langinfo.h... yes
      checking for wchar.h... yes
      checking for sys/select.h... yes
      checking for cxxabi.h... yes
      checking for an ANSI C-conforming const... yes
      checking for inline... inline
      checking size of short... 2
      checking size of void *... 8
      checking size of int... 4
      checking size of long... 8
      checking size of size_t... 8
      checking size of long long... 8
      checking size of wchar_t... 4
      checking for va_copy... yes
      checking for _FILE_OFFSET_BITS value needed for large files... 64
      checking if large file support is available... yes
      checking for _LARGEFILE_SOURCE value needed for large files... no
      checking whether byte ordering is bigendian... no
      checking for std::wstring in <string>... yes
      checking for std::istream... yes
      checking for std::ostream... yes
      checking for type_traits... yes
      checking for __sync_xxx_and_fetch builtins... yes
      checking for libraries directories... /usr/lib/x86_64-linux-gnu /usr/lib
      checking for cos... no
      checking for floor... no
      checking if floating point functions link without -lm... no
      checking for sin... yes
      checking for ceil... yes
      checking if floating point functions link with -lm... yes
      checking for strtoull... yes
      checking for pkg-config... /usr/bin/pkg-config
      checking pkg-config is at least version 0.9.0... yes
      checking for LIBPCRE... yes
      checking for zlib.h >= 1.1.4... yes
      checking for zlib.h... (cached) yes
      checking for deflate in -lz... yes
      checking for png.h > 0.90... no
      checking for png.h... (cached) no
      configure: WARNING: system png library not found or too old, will use built-in instead
      checking whether png.c file exists... yes
      checking for jpeglib.h... no
      configure: WARNING: system jpeg library not found, will use built-in instead
      checking whether jpeglib.h file exists... yes
      checking for jbg_dec_init in -ljbig... no
      checking for LIBTIFF... not found via pkg-config
      checking for tiffio.h... no
      configure: WARNING: system tiff library not found, will use built-in instead
      checking whether tiff.h file exists... yes
      checking for expat.h... yes
      checking if expat.h is valid C++ header... yes
      checking for XML_ParserCreate in -lexpat... yes
      checking for LIBCURL... not found
      checking for GTK+ version...
      checking for pkg-config... (cached) /usr/bin/pkg-config
      checking pkg-config is at least version 0.16... yes
      checking for GTK+ - version >= 3.0.0... Package gtk+-3.0 was not found in the pkg-config search path.
      Perhaps you should add the directory containing `gtk+-3.0.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'gtk+-3.0' found
      Package gthread-2.0 was not found in the pkg-config search path.
      Perhaps you should add the directory containing `gthread-2.0.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'gthread-2.0' found
      no
      *** Could not run GTK+ test program, checking why...
      *** The test program failed to compile or link. See the file config.log for the
      *** exact error that occurred. This usually means GTK+ is incorrectly installed.
      configure: error:
      The development files for GTK+ were not found. For GTK+ 2, please
      ensure that pkg-config is in the path and that gtk+-2.0.pc is
      installed. For GTK+ 1.2 please check that gtk-config is in the path,
      and that the version is 1.2.3 or above. Also check that the
      libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
      --libs' are in the LD_LIBRARY_PATH or equivalent.
      
      Error running configure
      ERROR: failed building wxWidgets
      Traceback (most recent call last):
        File "build.py", line 1563, in cmd_build_wx
          wxbuild.main(wxDir(), build_options)
        File "/tmp/pip-install-x1sgfktd/wxpython_b9652ea1547946a393162e6a5fea9a72/buildtools/build_wxwidgets.py", line 379, in main
          exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
        File "/tmp/pip-install-x1sgfktd/wxpython_b9652ea1547946a393162e6a5fea9a72/buildtools/build_wxwidgets.py", line 72, in exitIfError
          raise builder.BuildError(msg)
      buildtools.builder.BuildError: Error running configure
      Finished command: build_wx (0m3.703s)
      Finished command: build (0m3.703s)
      Command '"/usr/bin/python3" -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.

@Jason2866
Copy link
Owner

It is failing with gtk. Sorry can't help here (no PC where i could install Linux Mint). Using Apple M1 Arm and Github Actions uses Ubuntu
You have to find a way to get gtk installed on Linux Mint.

@Jason2866
Copy link
Owner

Can you try latest version?

@jeroenst
Copy link
Author

jeroenst commented Nov 9, 2023

pip install esp-flasher gives the same error. Do I need to execute another command to install the latest version?

@Jason2866
Copy link
Owner

Jason2866 commented Nov 9, 2023

The problem is installing wxpython. It is the gfx module dependency. On which Linux platform is Linux Mint 20.3 Cinnamon based?
Maybe this guide helps https://tutorialforlinux.com/2020/07/15/step-by-step-wxpython-python-3-linux-mint-20-installation/

@Jason2866
Copy link
Owner

this prerequisites

sudo apt install python3-pip make gcc libgtk-3-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev

and after that it should be possible to build wxPython

pip3 install -v --user wxPython

@Jason2866
Copy link
Owner

Jason2866 commented Nov 9, 2023

When wxpython is installing successful Install of ESP Flasher should work.

@Jason2866 Jason2866 changed the title Installing via pip fails Linux Mint 20.3: Installing via pip fails Nov 9, 2023
@jeroenst
Copy link
Author

jeroenst commented Jan 2, 2024

Sorry that it took so long before my reply, but I can confirm your prerequisites works for linux mint correctly.

I can now run esp flasher.

Thank you!

@jeroenst jeroenst closed this as completed Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants