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] playsound installation still failed after FAQ hint #253

Closed
NalaGinrut opened this issue Jun 2, 2024 · 6 comments
Closed

[BUG] playsound installation still failed after FAQ hint #253

NalaGinrut opened this issue Jun 2, 2024 · 6 comments
Assignees

Comments

@NalaGinrut
Copy link
Contributor

Describe the bug
The playsound installation still failed after FAQ hint.

System info

  • Ubuntu 24.04
  • Python 3.12.3

To Reproduce
Assuming the virtualenv process prepared successfully.

pip install -r requirements.txt

Error log

Collecting playsound
  Using cached 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
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "/home/ubuntu/Project/MoneyPrinter/.local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/ubuntu/Project/MoneyPrinter/.local/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/ubuntu/Project/MoneyPrinter/.local/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-3ip_es08/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-3ip_es08/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-3ip_es08/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-3ip_es08/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 6, in <module>
        File "/usr/lib/python3.12/inspect.py", line 1278, in getsource
          lines, lnum = getsourcelines(object)
                        ^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.12/inspect.py", line 1260, in getsourcelines
          lines, lnum = findsource(object)
                        ^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.12/inspect.py", line 1089, 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

× 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.

The FAQ hint doesn't work
In FAQ, it's hinted:

pip install -U wheel
pip install -U playsound

However, it doesn't solve the issue. It throws the same failure.

Thanks!

@FujiwaraChoki
Copy link
Owner

You're probably using the wrong interpreter. Try using python -m pip {...} instead of just pip {...}.

@FujiwaraChoki
Copy link
Owner

If that doesn't work either, try deleting the venv folder, re-initializing it, then running pip install -U wheel first, and then install all other requirements.

@NalaGinrut
Copy link
Contributor Author

I've tried python -m pip ... and remove venv then re-initializing, however, it still doesn't work.

@TheBinaryGuy
Copy link

TheBinaryGuy commented Jun 2, 2024

This is what worked for me: TaylorSMarks/playsound#150 (comment)

@NalaGinrut
Copy link
Contributor Author

NalaGinrut commented Jun 3, 2024

Thank you for all the helps!
The issue was solved by python3 -m pip install wheel playsound
The point is that one must make sure to upgrade the pacakage with the python in virtualenv dir.

And this part is necessary for me:

    python3 -m pip install --upgrade pip && \
    python3 -m pip install setuptools wheel && \
    python3 -m pip install --upgrade setuptools wheel && \
    python3 -m venv .venv && . .venv/bin/activate && \
    pip install -r requirements.txt

@FujiwaraChoki
Copy link
Owner

I thought you'd already tried that.. Well, whatever, glad it worked for you.

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

No branches or pull requests

3 participants