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

[BUG] It simply doesn't build in a venv #1046

Open
ManuLinares opened this issue Dec 22, 2023 · 11 comments · May be fixed by #1311
Open

[BUG] It simply doesn't build in a venv #1046

ManuLinares opened this issue Dec 22, 2023 · 11 comments · May be fixed by #1311

Comments

@ManuLinares
Copy link

System: Archlinux
Python 3.10.13 or Python 3.11.6

Steps to reproduce:

git clone https://github.com/Anjok07/ultimatevocalremovergui
cd ultimatevocalremovergui
python -m venv ./venv
source ./venv/bin/activate
pip install -r requirements.txt

#python 3.10

...
Collecting playsound==1.3.0 (from -r requirements.txt (line 24))
  Downloading playsound-1.3.0.tar.gz (7.7 kB)
  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
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "/home/mb/scripts/ultimatevocalremovergui/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/mb/scripts/ultimatevocalremovergui/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/mb/scripts/ultimatevocalremovergui/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-zsgbegyi/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-zsgbegyi/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-zsgbegyi/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-zsgbegyi/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 6, in <module>
        File "/usr/lib/python3.10/inspect.py", line 1139, in getsource
          lines, lnum = getsourcelines(object)
        File "/usr/lib/python3.10/inspect.py", line 1121, in getsourcelines
          lines, lnum = findsource(object)
        File "/usr/lib/python3.10/inspect.py", line 958, in findsource
          raise OSError('could not get source code')
      OSError: could not get source code
      [end of output]

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

#python 3.11

...
Collecting llvmlite==0.39.1 (from -r requirements.txt (line 13))
  Using cached llvmlite-0.39.1.tar.gz (132 kB)
  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 "/home/mb/scripts/ultimatevocalremovergui/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/mb/scripts/ultimatevocalremovergui/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/mb/scripts/ultimatevocalremovergui/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-f195g7g0/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-f195g7g0/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-f195g7g0/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-f195g7g0/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 55, in <module>
        File "<string>", line 52, in _guard_py_ver
      RuntimeError: Cannot install on Python version 3.11.6; only versions >=3.7,<3.11 are supported.
      [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.

@mithusingh32
Copy link

mithusingh32 commented Dec 31, 2023

I have similar issue, but I was able to get passed the failure at playsound.

  1. source /path/to/venv/bin/activate
  2. pip3 install playsound
  3. pip3 install -r requirement.txt

But you might run into a failure again further down.
Here's where I get a failure:

ollecting onnx (from -r requirements.txt (line 35))
  Using cached onnx-1.11.0.tar.gz (9.9 MB)
  Preparing metadata (setup.py) ... done
  Using cached onnx-1.10.2.tar.gz (9.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached onnx-1.10.1.tar.gz (10.0 MB)
  Preparing metadata (setup.py) ... done
  Using cached onnx-1.10.0.tar.gz (10.0 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [7 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-mq99n2sz/onnx_4ea4cb35d52e432e89bb19a3ad5cbb45/setup.py", line 318, in <module>
          raise FileNotFoundError("Unable to find " + requirements_file)
      FileNotFoundError: Unable to find requirements.txt
      [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.

Update

Check #1068 for the changes I made to get it to work properly.

@evezers evezers linked a pull request Apr 27, 2024 that will close this issue
@EmersonBiggons
Copy link

EmersonBiggons commented May 5, 2024

If people are still having issues with this I have a fix; just run this command (While in venv of course)
pip install --upgrade wheel and then run
pip3 install -r requirements.txt this seemed to fix it for me.

edit: For some reason I wasn't having issues with onnx before and I am now and I have no idea why. I'm getting that same FileNotFoundError: Unable to find requirements.txt error as the above text, I wasn't before and I am now upon trying to install it from scratch.

@mortalis13
Copy link

TaylorSMarks/playsound#150
Searching for the concrete library issues normally helps too,
though I see the solution was given after this ticket was created.

@mortalis13
Copy link

mortalis13 commented May 31, 2024

Leaving here the sequence that worked for me.
Windows 10, Python 3.11.

  • set numpy==1.24.2 in the requirements.txt, for the lower version has conflicts with multiple libraries
  • create venv
  • set SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True, for the warning from the sklearn library
  • pip install wheel, for the playsound issue with OSError: could not get source code
  • pip install -r requirements.txt
  • python UVR.py

For sklearn sub-dependency, the library informs The 'sklearn' PyPI package is deprecated, use 'scikit-learn' rather than 'sklearn' for pip commands.. So it would be better to use the library they propose, but it's not directly in the requirements.txt, so it has to be investigated which library has this dependency and maybe try to change that library version, but it's much faster to use the env variable for now.

@ManuLinares
Copy link
Author

ManuLinares commented May 31, 2024

Still doesn't build, now the error appear to be "audioread".

Steps to reproduce in a fresh install.

git clone https://github.com/Anjok07/ultimatevocalremovergui
cd ultimatevocalremovergui
python3 -m venv ./venv
source ./venv/bin/activate
pip install -r requirements.txt
Ignoring PySoundFile: markers 'sys_platform == "darwin"' don't match your environment
Collecting altgraph==0.17.3 (from -r requirements.txt (line 1))
  Using cached altgraph-0.17.3-py2.py3-none-any.whl.metadata (7.4 kB)
Collecting audioread==3.0.0 (from -r requirements.txt (line 2))
  Using cached audioread-3.0.0.tar.gz (377 kB)
  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
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/home/mb/scripts/ultimatevocalremovergui/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/mb/scripts/ultimatevocalremovergui/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/mb/scripts/ultimatevocalremovergui/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-6c9ffbhv/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-6c9ffbhv/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-6c9ffbhv/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-6c9ffbhv/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 17, in <module>
      ModuleNotFoundError: No module named 'imp'
      [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.

Archlinux:
python 3.12.3-1
python-pip 24.0-2
tk 8.6.14-3
ffmpeg 2:6.1.1-7

@mortalis13
Copy link

OK, I haven't received the same error, but understood that due to caching it's not enough to only change the numpy version.
I removed the pip cache and started from the beginning.
Check the updated steps above if it helps.

@mortalis13
Copy link

Here is the output of full install according to the steps above, with removed cache folder before the run.
I only see the cached Cython, but that should be something internal for python itself.
In theory, it should be possible to take those versions and install them directly, or from another requirements.txt and the project should be runnable.

pip-log.txt

@mortalis13
Copy link

Well basically pip-freeze maybe would be more useful...
pip-freeze.txt

@ManuLinares
Copy link
Author

I thinks you are trying to help but I don't know why are you spamming 👍

Are you saying I should use/downgrade to Python 3.11?

Nowhere in the documentation says that is a requirement.

The installation instructions for any Linux environment should be this simple:

git clone https://github.com/Anjok07/ultimatevocalremovergui && cd ultimatevocalremovergui
python3 -m venv ./venv
source ./venv/bin/activate
pip install -r requirements.txt

If that doesn't work, then the "requirements.txt" is wrong and/or the Python version should be specified somewhere.

@mortalis13
Copy link

I'm not spamming. I investigated the problem and found a solution that works for me.
You can do whatever you want. I propose options that could help. It's up to you to check multiple approaches and test with python versions, OSs etc. or just wait a miracle from the sky that auto solves every problem.
In tech/programming environment there can be a lot of reasons why some code doesn't work, like OS compatibility, framework/libraries versions which can work at some moment of time, and then the next day something internal or external changes and that "perfect" combination stops working.

The last change to the repo was some time ago, it was probably working at that time. But during that period libraries without versions in the "requirements" surely have changed and are no longer compatible with the fixed-version libraries.

Python version I saw in the readme is 3.9 btw...

@mortalis13
Copy link

Besides I'd say the python version is probably not the issue, although it could be,
I've left other clues before, regarding versions, env variables and cache...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants