Gradio cannot install

Question:

I tried several ways to install gradio. But it gives this error every time. I can’t install it. What could be the solution?

C:Usersugurn>pip install gradio
Collecting gradio
  Using cached gradio-3.15.0-py3-none-any.whl (13.8 MB)
Collecting python-multipart
  Using cached python-multipart-0.0.5.tar.gz (32 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:UsersugurnAppDataLocalTemppip-install-z61k1lxdpython-multipart_8b04b9f47ece46d0a012ed3b3c3183cbsetup.py", line 19, in <module>
          setup(name='python-multipart',
        File "C:UsersugurnAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagessetuptools__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "C:UsersugurnAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagessetuptools_distutilscore.py", line 147, in setup
          _setup_distribution = dist = klass(attrs)
        File "C:UsersugurnAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagessetuptoolsdist.py", line 475, in __init__
          _Distribution.__init__(
        File "C:UsersugurnAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagessetuptools_distutilsdist.py", line 283, in __init__
          self.finalize_options()
        File "C:UsersugurnAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagessetuptoolsdist.py", line 898, in finalize_options
          for ep in sorted(loaded, key=by_order):
        File "C:UsersugurnAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagessetuptoolsdist.py", line 897, in <lambda>
          loaded = map(lambda e: e.load(), filtered)
        File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0libimportlibmetadata__init__.py", line 171, in load
          module = import_module(match.group('module'))
        File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0libimportlib__init__.py", line 126, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 883, in exec_module
        File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
        File "C:UsersugurnAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagespy2appbuild_app.py", line 37, in <module>
          from py2app.create_appbundle import create_appbundle
        File "C:UsersugurnAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagespy2appcreate_appbundle.py", line 9, in <module>
          from py2app.util import make_exec, makedirs, mergecopy, mergetree, skipscm
        File "C:UsersugurnAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagespy2apputil.py", line 5, in <module>
          import fcntl
      ModuleNotFoundError: No module named 'fcntl'
      [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 want to install Gradio without any problem

Asked By: Fuinithil

||

Answers:

The problem is not related to gradio. You have installed py2app on your Windows but https://pypi.org/project/py2app/ is only for Mac OS X. Uninstall py2app:

pip uninstall -y py2app

or remove the directory C:UsersugurnAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagespy2app

Answered By: phd
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.