简体   繁体   中英

Error when installing pyinstaller version 4.3. How to fix it?

When I try to install pyinstaller version 4.3. Then I got unwanted erro that I have pasted below. Please help me to get out of this error.

My current pip version is 22.2. And python version is 3.7.

C:\WINDOWS\system32>pip install --no-cache-dir pyinstaller==4.3
Collecting pyinstaller==4.3
  Downloading pyinstaller-4.3.tar.gz (3.7 MB)
     ---------------------------------------- 3.7/3.7 MB 5.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [41 lines of output]

  Traceback (most recent call last):
    File "c:\users\abhis\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
      main()
    File "c:\users\abhis\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "c:\users\abhis\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 164, in prepare_metadata_for_build_wheel
      return hook(metadata_directory, config_settings)
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\build_meta.py", line 188, in prepare_metadata_for_build_wheel
      self.run_setup()
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\build_meta.py", line 282, in run_setup
      self).run_setup(setup_script=setup_script)
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
      exec(code, locals())
    File "<string>", line 78, in <module>
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 151, in setup
      dist.parse_config_files()
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\dist.py", line 865, in parse_config_files
      self, self.command_options, ignore_option_errors=ignore_option_errors
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 172, in parse_configuration
      meta.parse()
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 451, in parse
      section_parser_method(section_options)
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 422, in parse_section
      self[name] = value
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 243, in __setitem__
      value = parser(value)
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 557, in _parse_version
      return expand.version(self._parse_attr(value, self.package_dir, self.root_dir))
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 377, in _parse_attr
      return expand.read_attr(attr_desc, package_dir, root_dir)
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\config\expand.py", line 192, in read_attr
      module = _load_spec(spec, module_name)
    File "C:\Users\abhis\AppData\Local\Temp\pip-build-env-l2t7s_bi\overlay\Lib\site-packages\setuptools\config\expand.py", line 212, in _load_spec
      spec.loader.exec_module(module)  # type: ignore
    File "<frozen importlib._bootstrap_external>", line 728, in exec_module
    File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
     File "C:\Users\abhis\AppData\Local\Temp\pip-install-oxwzokmn\pyinstaller_8996853206574e95a5a7117dbcd6cb01\PyInstaller.py", line 16, in <module>
          from PyInstaller.__main__ import run
      ModuleNotFoundError: No module named 'PyInstaller.__main__'; 'PyInstaller' is not a package
      [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.

The error is located specifically in the pyproject.toml file..toml files are used to do configuration in project using a minimalist language. It's mainly used to point the author of the project and its contact, a server direction with its accessible ports, an url to an API to scrap data, etc.

It seems that its an internal bug in the configuration of that file, which is used on the installment of PyInstaller. I recommend checking if that version is unstable. Try installing the previous one.

pip3 install --no-cache-dir pyinstaller==4.2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM