When running the following command I get an error

Quoted Text Here

python3 -m pip install -r requirements.txt
Defaulting to user installation because normal site-packages is not writeable
Collecting faster-whisper==1.0.2 (from -r requirements.txt (line 1))
  Downloading faster_whisper-1.0.2-py3-none-any.whl.metadata (15 kB)
Collecting groq==0.6.0 (from -r requirements.txt (line 2))
  Downloading groq-0.6.0-py3-none-any.whl.metadata (13 kB)
Collecting openai==1.30.1 (from -r requirements.txt (line 3))
  Downloading openai-1.30.1-py3-none-any.whl.metadata (21 kB)
Collecting google-generativeai==0.5.4 (from -r requirements.txt (line 4))
  Downloading google_generativeai-0.5.4-py3-none-any.whl.metadata (3.9 kB)
Collecting opencv_python==4.9.0.80 (from -r requirements.txt (line 5))
  Downloading opencv_python-4.9.0.80-cp37-abi3-win_amd64.whl.metadata (20 kB)
Collecting Pillow==10.3.0 (from -r requirements.txt (line 6))
  Downloading pillow-10.3.0.tar.gz (46.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.6/46.6 MB 4.4 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      Traceback (most recent call last):
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.496.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>  
          main()
          ~~~~^^
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.496.0_x64__qbz5n2kfra8p0\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 "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.496.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\Corne\AppData\Local\Temp\pip-build-env-347jmnju\overlay\Lib\site-packages\setuptools\build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Corne\AppData\Local\Temp\pip-build-env-347jmnju\overlay\Lib\site-packages\setuptools\build_meta.py", line 304, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "C:\Users\Corne\AppData\Local\Temp\pip-build-env-347jmnju\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 33, in <module>
        File "<string>", line 27, in get_version
      KeyError: '__version__'
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip

Can anyone help?

Can you please post the contents of requirements.txt?

I don't know if this will make a difference, but when I install python I always put it in

c:\python

and install for all users. I find it much easier when trying to fix problems like this to have all the files in a top level folder rather than buried multiple levels down in appdata...whatever.

I have faced similar issues before! Sometimes the problem is related to incorrect indentation. Python is very particular about spaces, so double-checking your code can help fix the issue.

Hi Ccrobinson001,

I've just attempted installing to my system but could not reproduce the issue. Everything installed as expected.
Maybe you could try upgrading pip and setuptools first, if you haven't done so already?

pip install --upgrade pip setuptools

I recreated your requirements.txt file based on the output that you provided. Please see below. Is it correct?

faster-whisper==1.0.2
groq==0.6.0
openai==1.30.1
google-generativeai==0.5.4
opencv_python==4.9.0.80
Pillow==10.3.0

I then created a virtual Python environment using python -m venv env, activated with .\env\scripts\activate.bat, and then ran python3 -m pip install -r requirements.txt. I'm using Python 3.11.9 on Windows 10.

Let us know what the issue was if you manage to resolve it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.