umyelab / LabGym

Quantify user-defined behaviors.
GNU General Public License v3.0
64 stars 5 forks source link

Unable to install wxPython during LabGym installation #3

Closed LonyTevin closed 2 years ago

LonyTevin commented 2 years ago

Hi! After running 'pip install LabGym', each package is installed correctly until wxPython. The error code claims that Microsoft Visual C++ 14.2 or greater is required, but this machine has Microsoft Visual C++ 2015-2022 Redistributable installed (14.31.31103.0). Any help with this would be greatly appreciated.

Full error is given below:

error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [51 lines of output] C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\dist.py:717: 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:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\dist.py:294: DistDeprecationWarning: use_2to3 is ignored. warnings.warn(f"{attr} is ignored.", DistDeprecationWarning) running bdistwheel running build C:\Users\xxxxx\AppData\Local\Temp\pip-install-ceaufv1\wxpython_599da007bd69489382ec4688da01f7ae\build.py:41: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.dep_util import newer, newer_group Will build using: "C:\Users\xxxxx\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe" 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] Python's architecture is 64bit cfg.VERSION: 4.1.1

  Running command: build
  Running command: build_wx
  Command '"C:\Users\xxxxx\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe" -c "import setuptools, distutils.msvc9compiler as msvc; mc = msvc.MSVCCompiler(); mc.initialize(); print(mc.cc)"' failed with exit code 1.
  Traceback (most recent call last):

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

    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\distutils\msvc9compiler.py", line 371, in initialize

      vc_env = query_vcvarsall(VERSION, plat_spec)

    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\msvc.py", line 140, in msvc9_query_vcvarsall

      return EnvironmentInfo(arch, ver).return_env()

    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\msvc.py", line 1740, in return_env

      [self.VCIncludes,

    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\msvc.py", line 1282, in VCIncludes

      return [join(self.si.VCInstallDir, 'Include'),

    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\msvc.py", line 840, in VCInstallDir

      raise distutils.errors.DistutilsPlatformError(msg)

  distutils.errors.DistutilsPlatformError: **Microsoft Visual C++ 14.2 or greater is required.** Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  Finished command: build_wx (0.340s)
  Finished command: build (0.340s)
  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\xxxxx\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe" -u build.py build
  Command '"C:\Users\xxxxx\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\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: Failed building wheel for wxPython Running setup.py clean for wxPython Failed to build wxPython Installing collected packages: wxPython, tqdm, tifffile, scipy, requests, PyWavelets, python-dateutil, packaging, opt-einsum, openpyxl, opencv-python, opencv-contrib-python, keras-preprocessing, imageio, h5py, grpcio, google-pasta, astunparse, absl-py, scikit-learn, scikit-image, requests-oauthlib, proglog, pandas, matplotlib, google-auth, seaborn, moviepy, google-auth-oauthlib, tensorboard, tensorflow, LabGym 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 ╰─> [51 lines of output] C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\dist.py:717: 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:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\dist.py:294: DistDeprecationWarning: use2to3 is ignored. warnings.warn(f"{attr} is ignored.", DistDeprecationWarning) running install running build C:\Users\xxxxx\AppData\Local\Temp\pip-install-ceaufv1\wxpython_599da007bd69489382ec4688da01f7ae\build.py:41: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.dep_util import newer, newer_group Will build using: "C:\Users\xxxxx\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe" 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] Python's architecture is 64bit cfg.VERSION: 4.1.1

  Running command: build
  Running command: build_wx
  Command '"C:\Users\xxxxx\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe" -c "import setuptools, distutils.msvc9compiler as msvc; mc = msvc.MSVCCompiler(); mc.initialize(); print(mc.cc)"' failed with exit code 1.
  Traceback (most recent call last):

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

    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\distutils\msvc9compiler.py", line 371, in initialize

      vc_env = query_vcvarsall(VERSION, plat_spec)

    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\msvc.py", line 140, in msvc9_query_vcvarsall

      return EnvironmentInfo(arch, ver).return_env()

    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\msvc.py", line 1740, in return_env

      [self.VCIncludes,

    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\msvc.py", line 1282, in VCIncludes

      return [join(self.si.VCInstallDir, 'Include'),

    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\msvc.py", line 840, in VCInstallDir

      raise distutils.errors.DistutilsPlatformError(msg)

  distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  Finished command: build_wx (0.345s)
  Finished command: build (0.345s)
  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\xxxxx\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe" -u build.py build
  Command '"C:\Users\xxxxx\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe" -u build.py build' failed with exit code 1.
  [end of output]
yujiahu415 commented 2 years ago

Hi,

The cause of this issue might be that you're using the latest version of python (python3.10), which might not be supported by some python library yet. Uninstall python 3.10 and install a python 3.9.8 through installer (https://www.python.org/downloads/release/python-388/) should solve the issue. If you have multiple versions of python3 installed, try to install LabGym under python3.9.8 and initiate the python3.9.8 interactive shell to run LabGym.

Let me know if this address the issue or there is any additional issue. Thanks!

LonyTevin commented 2 years ago

Hi, Thanks for the speedy reply! I wasn't even aware I had Python 3.10 installed, since for other Python based software I've been using Anaconda which is currently using Python 3.9.12. Sure enough, uninstalling all other versions of Python I had installed and installing 3.9.12 fixed the problem, and thankfully Anaconda is still functional! Thanks very much :)