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

Preparing metadata (pyproject.toml) did not run successfully. #942

Closed
satishBohra opened this issue Aug 9, 2023 · 25 comments
Closed

Preparing metadata (pyproject.toml) did not run successfully. #942

satishBohra opened this issue Aug 9, 2023 · 25 comments
Labels
bug Something isn't working primordial Related to the primordial version of PrivateGPT, which is now frozen in favour of the new PrivateGPT

Comments

@satishBohra
Copy link

satishBohra commented Aug 9, 2023

Note: if you'd like to ask a question or open a discussion, head over to the Discussions section and post it there.
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [86 lines of output]
Traceback (most recent call last):
File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\expand.py", line 81, in getattr
return next(
^^^^^
File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\expand.py", line 82, in
ast.literal_eval(value)
File "C:\Users\Satish\AppData\Local\Programs\Python\Python311\Lib\ast.py", line 110, in literal_eval
return _convert(node_or_string)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Satish\AppData\Local\Programs\Python\Python311\Lib\ast.py", line 109, in _convert
return _convert_signed_num(node)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Satish\AppData\Local\Programs\Python\Python311\Lib\ast.py", line 83, in _convert_signed_num
return _convert_num(node)
^^^^^^^^^^^^^^^^^^
File "C:\Users\Satish\AppData\Local\Programs\Python\Python311\Lib\ast.py", line 74, in _convert_num
_raise_malformed_node(node)
File "C:\Users\Satish\AppData\Local\Programs\Python\Python311\Lib\ast.py", line 71, in _raise_malformed_node
raise ValueError(msg + f': {node!r}')
ValueError: malformed node or string on line 2: <ast.Call object at 0x0000025683AD1330>

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\expand.py", line 191, in read_attr
      return getattr(StaticModule(module_name, spec), attr_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\expand.py", line 87, in __getattr__
      raise AttributeError(f"{self.name} has no attribute {attr}") from e
  AttributeError: wrapt has no attribute __version__

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "D:\AI\privateGPT\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "D:\AI\privateGPT\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "D:\AI\privateGPT\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
      return hook(metadata_directory, config_settings)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\build_meta.py", line 380, in prepare_metadata_for_build_wheel
      self.run_setup()
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\build_meta.py", line 488, in run_setup
      self).run_setup(setup_script=setup_script)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 41, in <module>
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\__init__.py", line 107, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 159, in setup
      dist.parse_config_files()
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\dist.py", line 894, in parse_config_files
      setupcfg.parse_configuration(
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 189, in parse_configuration
      meta.parse()
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 500, in parse
      section_parser_method(section_options)
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 475, in parse_section
      self[name] = value
      ~~~~^^^^^^
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 293, in __setitem__
      parsed = self.parsers.get(option_name, lambda x: x)(value)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 606, in _parse_version
      return expand.version(self._parse_attr(value, self.package_dir, self.root_dir))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\setupcfg.py", line 417, in _parse_attr
      return expand.read_attr(attr_desc, package_dir, root_dir)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\expand.py", line 194, in read_attr
      module = _load_spec(spec, module_name)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\Satish\AppData\Local\Temp\pip-build-env-om9hg96c\overlay\Lib\site-packages\setuptools\config\expand.py", line 214, in _load_spec
      spec.loader.exec_module(module)  # type: ignore
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<frozen importlib._bootstrap_external>", line 940, in exec_module
    File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
    File "C:\Users\Satish\AppData\Local\Temp\pip-install-ylbme06r\wrapt_dff331c8503648abaaedba4896fd2642\src\wrapt\__init__.py", line 10, in <module>
      from .decorators import (adapter_factory, AdapterFactory, decorator,
    File "C:\Users\Satish\AppData\Local\Temp\pip-install-ylbme06r\wrapt_dff331c8503648abaaedba4896fd2642\src\wrapt\decorators.py", line 34, in <module>
      from inspect import ismethod, isclass, formatargspec
  ImportError: cannot import name 'formatargspec' from 'inspect' (C:\Users\Satish\AppData\Local\Programs\Python\Python311\Lib\inspect.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.
Describe the bug and how to reproduce it
A clear and concise description of what the bug is and the steps to reproduce the behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • OS / hardware: Windows 11 pro
  • Python version3.11.4
  • Other relevant information

Additional context
Add any other context about the problem here.

@satishBohra satishBohra added the bug Something isn't working label Aug 9, 2023
@gadams999
Copy link

gadams999 commented Aug 9, 2023

Also seen on macOS using Python 3.11.4.

Using Python 3.10.12, pip install -r requirements.txt completed correctly from main branch.

Edit: Tested with Python 3.10.

@bhavik-goplani
Copy link

Faced the same bug but installed dependencies one by one, which works.

@frikishaan
Copy link

frikishaan commented Aug 13, 2023

It works form me on Python version 3.10.11.
Also, I have to install C++ compiler, check out the system requirements section.

@TristynAlxander
Copy link

TristynAlxander commented Aug 13, 2023

I fixed a similar issue by using Python version 3.10.10 on linux-mint. I think it's a wrapt issue caused by python 3.11 deprecations. I didn't try versions other than 3.10.10, but given the other comments I suspect anything less than 3.11 would work. After downloading the LLM and editing the env to add its (absolute) path, I also had to use pip install sentence_transformers for langchain.

Now I have it working.

@vivek5130
Copy link

same issue with me using python version 3.113 on windows 10 os.

@Johnny-Connor
Copy link

Same issue, solutions listed here did not work.

@rahulkjain
Copy link

faced the same with Python 3.11.4. Worked fine with 3.10 and installing C++ Universal Windows Platform Support

@admin0987iu
Copy link

I think i handle some of the error that i have try follow these steps

0.pip cache purge
😏pip install meson
1.python -m pip install --upgrade pip
😎pip install importlib-metadata
2.python -m pip install --upgrade setuptools
😇pip install subprocess.run
3.pip3 install wheel setuptools pip --upgrade
🤨pip install toml
4.pip install numpy --use-deprecated=legacy-resolver
🤨pip install setuptools-metadata

@Hamaddah
Copy link

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

problem still exists

@AlbertZhabaliev
Copy link

Downgrading to Python 3.10.x solved the issue for me. Hope it helps.

@MatheusPerpetua
Copy link

Same problem here

@imartinez imartinez added the primordial Related to the primordial version of PrivateGPT, which is now frozen in favour of the new PrivateGPT label Oct 19, 2023
@xueqings
Copy link

xueqings commented Nov 4, 2023

you can try python 3.8, I solve the problem successfully.

@Jawad-Khalil
Copy link

The same type of error occurred for me during the installation of the scipy package on Python 3.9.13
Try to install nearly below or above version of scipy with the Python version release date.
For example, if you have Python 3.9.13 (release date: May 17, 2022) (as in my case), try to install the scipy package version 1.8.1 (release date: May 18, 2022).
I don't know whether it will work for you in your case but it worked for me to install more than 2 packages with the same issue.
Python 3.9.13
Pillow 9.5.0
scipy 1.8.1
matplotlib 3.7.1

meta data generation faild

@originalsaizo
Copy link

I also get the same type of error. However, I'm on a RaspberryPi 4, and running Python 3.11.2.
What I'm trying to install (for Thonny), is QCustomPlot_PyQt5. I tested even QCustomPlot_PyQt6, still get the same issue.

Further research, on my system, I could see that some packages/software was not completely installed.

If someone else has same version of Python (3.11.2), and is running Bookworm, let me know if you solved it, and which steps to take.

@kickoffpro
Copy link

for me too in my MacAir Big Sur, every install using brew if its needed python-hatchling, this errors will in some way.

Captura de Tela 2024-01-16 às 14 49 59

@Karthikeyakucham6918
Copy link

How can i resolve this error in windows 11 -Python 3.12.2

Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

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

  Cargo, the Rust package manager, is not installed or is not on PATH.
  This package requires Rust and Cargo to compile extensions. Install it through
  the system's package manager or via https://rustup.rs/

  Checking for Rust toolchain....
  [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.

@MikePendo
Copy link

I installed Cargo from here: https://rustup.rs
and added to the path

@Harishprabhu30
Copy link

Harishprabhu30 commented Jun 22, 2024

Yes! DOWNGRADING THE PYTHON VERSION FROM 3.11 TO 3.10
SOLVES THE ERROR.

@Priyasdvh
Copy link

Could be resolved if you install required pip one by one

@Hypes-Astro
Copy link

pip install matplotlib==3.8.4

it works

@Hypes-Astro
Copy link

Same problem here

pip install matplotlib==3.8.4
it works. i got python 3.11

image

image

@tbiber2
Copy link

tbiber2 commented Aug 4, 2024

pip install matplotlib==3.8.4 worked for me, too.

@Carlolopespesia
Copy link

pip install matplotlib==3.8.4

it works

It works! Thank you a lot!!!

@Vikisss
Copy link

Vikisss commented Aug 16, 2024

same problem

@jodomaq
Copy link

jodomaq commented Aug 21, 2024

You are not writing the package correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working primordial Related to the primordial version of PrivateGPT, which is now frozen in favour of the new PrivateGPT
Projects
None yet
Development

No branches or pull requests