Can't install pyo using pip

Issue

When trying to install pyo using pip I get error

$ pip install pyo

Collecting pyo 
 Using cached pyo-1.0.4.tar.gz (6.1 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\VA\AppData\Local\Temp\pip-install-06kfbyzb\pyo_9bd28f6f7eba4c5aa2896ae564b089f6\setup.py", line 293, in <module>
          for f in os.listdir(data_files_common_path)
      FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
      [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.

Then I tried

$ pip install pyo –use-deprecated=backtrack-on-build-failures

DEPRECATION: Backtracking on build failures can mask issues related to how a package generates metadata or builds a wheel. This flag will be removed in pip 22.2. A possible replacement is avoiding known-bad versions by explicitly telling pip to ignore them (either directly as requirements, or via a constraints file). Discussion can be found at https://github.com/pypa/pip/issues/10655
Collecting pyo
  Using cached pyo-1.0.4.tar.gz (6.1 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\VA\AppData\Local\Temp\pip-install-_t68yako\pyo_d26c3df31ce44e44babd1e5def6de075\setup.py", line 293, in <module>
          for f in os.listdir(data_files_common_path)
      FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: Discarding https://files.pythonhosted.org/packages/7a/4a/a681a4c1c6db790b39f24c3384debedd583db48bea47362640ebcab1f3a6/pyo-1.0.4.tar.gz#sha256=34937eba641ed6b1c8ede1c35f30ad5e08493ec1f09352398790910bfd19d445 (from https://pypi.org/simple/pyo/) (requires-python:>=3.6, <4) due to build failure: metadata generation failed
  Using cached pyo-1.0.3.tar.gz (5.2 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\VA\AppData\Local\Temp\pip-install-_t68yako\pyo_3f80885b827046bbb8de3e7c16e16c7b\setup.py", line 215, in <module>
          [os.path.join(data_files_common_path, f) for f in os.listdir(data_files_common_path) if f.endswith(".dll")])]
      FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: Discarding https://files.pythonhosted.org/packages/60/ea/e717ec9cef74dc4a26000b29b1cf8703e2871d9edaae189dc515d8e74910/pyo-1.0.3.tar.gz#sha256=f0d187a78e3ab9f10275853a22b6a08094aeed4e0c2adee8697734373aa8dd1f (from https://pypi.org/simple/pyo/) (requires-python:>=3.6, <4) due to build failure: metadata generation failed
  Using cached pyo-1.0.2.tar.gz (5.2 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\VA\AppData\Local\Temp\pip-install-_t68yako\pyo_7636aa31397442f693130603d4cb92d8\setup.py", line 215, in <module>
          [os.path.join(data_files_common_path, f) for f in os.listdir(data_files_common_path) if f.endswith(".dll")])]
      FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: Discarding https://files.pythonhosted.org/packages/4c/48/2b5ea0d2e52edbb3d440fbbf7992f52c9727b2c4117f11b6348abf51706b/pyo-1.0.2.tar.gz#sha256=cb716d2c38a02f3aafba2cb5a47af67d78433580f6536c57fd0883283d3bf64a (from https://pypi.org/simple/pyo/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4) due to build failure: metadata generation failed
  Using cached pyo-1.0.1.tar.gz (5.2 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\VA\AppData\Local\Temp\pip-install-_t68yako\pyo_9550d20742e24085af8ace9202cb7913\setup.py", line 212, in <module>
          [os.path.join(data_files_common_path, f) for f in os.listdir(data_files_common_path) if f.endswith(".dll")])]
      FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: Discarding https://files.pythonhosted.org/packages/9c/f2/87f07599a2f107f02a9f7cf11599c5eecf37662356296e1236c17ec997f4/pyo-1.0.1.tar.gz#sha256=e85a3e9e4e17769c4178c907e6b8f01bc455fe0fa348b0ce64d5698ec7e82202 (from https://pypi.org/simple/pyo/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4) due to build failure: metadata generation failed
  Using cached pyo-1.0.0.tar.gz (5.1 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\VA\AppData\Local\Temp\pip-install-_t68yako\pyo_712915a0221348b59415409f622bde9f\setup.py", line 211, in <module>
          [os.path.join(data_files_common_path, f) for f in os.listdir(data_files_common_path) if f.endswith(".dll")])]
      FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: Discarding https://files.pythonhosted.org/packages/67/0f/2c3f9fb88effc62571c209525b5e84d1ec0b68611c916daa96ae8c84f43f/pyo-1.0.0.tar.gz#sha256=4ad45d32ae6ef5865762594223bddf0d6efa7e45657b899b16cda33ce328ebfd (from https://pypi.org/simple/pyo/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4) due to build failure: metadata generation failed
ERROR: Could not find a version that satisfies the requirement pyo (from versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4)
ERROR: No matching distribution found for pyo

The python version

$ python –version

Python 3.10.4

Tried to install AJAX SOUND STUDIO pyo

For AJax Sound studio I tried with latest pyo 0.9.1 but still error persists so I tried with pyo 0.8.4.

Still the issue is not solved.

The above terminal output is from Anaconda Promt from Windows. I also tried to install pyo in Ubuntu. In that OS also I am facing issues with installing PYO.

Terminal output for installation in Ubuntu

$ pip install pyo

Terminal output

tried to install pyo using conda but package is not found

$ conda install pyo

Solution

Looking at [PyPI]: PYO 1.0.4 – Download files (newest published version at answer time), prebuilt .whls (for Win) are available if all below apply:

  • Python version: v3.9, v3.8, v3.7, v3.6

  • Python arch: pc064 (win_amd64)

Also, building from sources (fall back if no prebuilt .whl available), is complex (and doesn’t work OOTB – only tried for Win, but I’m 99% sure that it’s the same for Nix) as it requires some additional steps (building / using a bunch of dependencies), so the error pops up (if fixed, another will, and so on).

So, stick with supported Python versions until a new PYO version will be released (this one is 1+ year old).
Of course building from sources is an option, but it requires deeper knowledge.


Update #0

Built .whls and published them on [GitHub]: CristiFati/Prebuilt-Binaries – (master) Prebuilt-Binaries/PyO/v1.0.4 (win_amd64 for Python: v3.11, v3.10 and win32 for current Python versions).

I used the following script to (quickly) test them.

code00.py:

#!/usr/bin/env python

import sys
import time

import pyo


def main(*argv):
    sample_name = "Sine"
    sample_class = getattr(pyo, sample_name, None)
    if sample_class is None:
        print("Invalid sample: {:s}".format(sample_name))
        return -1
    secs = 2
    out_file = "{:s}.wav".format(sample_name)
    srv = pyo.Server().boot()
    print("Playing sound ({:s}) for {:.3f} seconds (and saving to '{:s}') ...".format(sample_name, secs, out_file))
    srv.start()
    srv.recstart(out_file)
    sample = sample_class(mul=0.01).out()
    print("Sample: {:}".format(sample))
    time.sleep(secs)
    srv.recstop()
    srv.stop()
    sfp = pyo.SfPlayer(out_file)
    print("SFP: {:}".format(sfp))


if __name__ == "__main__":
    print("Python {:s} {:03d}bit on {:s}\n".format(" ".join(elem.strip() for elem in sys.version.split("\n")),
                                                   64 if sys.maxsize > 0x100000000 else 32, sys.platform))
    rc = main(*sys.argv[1:])
    print("\nDone.\n")
    sys.exit(rc)

Output:

[[email protected]:e:\Work\Dev\StackOverflow\q073508905]> sopr.bat
### Set shorter prompt to better fit when pasted in StackOverflow (or other) pages ###

[prompt]> :: ------- PYTHON 3.10 -------
[prompt]> "e:\Work\Dev\VEnvs\py_pc064_03.10_test0\Scripts\python.exe" -m pip install "e:\Work\Dev\GitHub\CristiFati\Prebuilt-Binaries\pyo\v1.0.4\pyo-1.0.4-cp310-cp310-win_amd64.whl"
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Processing e:\work\dev\github\cristifati\prebuilt-binaries\pyo\v1.0.4\pyo-1.0.4-cp310-cp310-win_amd64.whl
Installing collected packages: pyo
Successfully installed pyo-1.0.4
WARNING: You are using pip version 21.3.1; however, version 22.2.2 is available.
You should consider upgrading via the 'e:\Work\Dev\VEnvs\py_pc064_03.10_test0\Scripts\python.exe -m pip install --upgrade pip' command.

[prompt]>
[prompt]> "e:\Work\Dev\VEnvs\py_pc064_03.10_test0\Scripts\python.exe" ./code00.py

WxPython is not found for the current python version.
Pyo will use a minimal GUI toolkit written with Tkinter (if available).
This toolkit has limited functionnalities and is no more
maintained or updated. If you want to use all of pyo's
GUI features, you should install WxPython, available here:
http://www.wxpython.org/

Python 3.10.1 (tags/v3.10.1:2cd268a, Dec  6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] 064bit on win32

Pyo warning: Portmidi closed.
Playing sound (Sine) for 2.000 seconds (and saving to 'Sine.wav') ...
Sample: < Instance of Sine class >
SFP: < Instance of SfPlayer class >

Done.


[prompt]>
[prompt]> :: ------- PYTHON 3.11 -------
[prompt]> "e:\Work\Dev\VEnvs\py_pc064_03.11_test0\Scripts\python.exe" -m pip install "e:\Work\Dev\GitHub\CristiFati\Prebuilt-Binaries\pyo\v1.0.4\pyo-1.0.4-cp311-cp311-win_amd64.whl"
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Processing e:\work\dev\github\cristifati\prebuilt-binaries\pyo\v1.0.4\pyo-1.0.4-cp311-cp311-win_amd64.whl
Installing collected packages: pyo
Successfully installed pyo-1.0.4
WARNING: You are using pip version 21.3.1; however, version 22.2.2 is available.
You should consider upgrading via the 'e:\Work\Dev\VEnvs\py_pc064_03.11_test0\Scripts\python.exe -m pip install --upgrade pip' command.

[prompt]>
[prompt]> "e:\Work\Dev\VEnvs\py_pc064_03.11_test0\Scripts\python.exe" ./code00.py

WxPython is not found for the current python version.
Pyo will use a minimal GUI toolkit written with Tkinter (if available).
This toolkit has limited functionnalities and is no more
maintained or updated. If you want to use all of pyo's
GUI features, you should install WxPython, available here:
http://www.wxpython.org/

Python 3.11.0rc1 (main, Aug  8 2022, 11:30:54) [MSC v.1932 64 bit (AMD64)] 064bit on win32

Pyo warning: Portmidi closed.
Playing sound (Sine) for 2.000 seconds (and saving to 'Sine.wav') ...
Sample: < Instance of Sine class >
SFP: < Instance of SfPlayer class >

Done.


[prompt]>
[prompt]> :: ------- PYTHON 3.7 (!!! PC032 !!!) -------
[prompt]> "e:\Work\Dev\VEnvs\py_pc032_03.07_test0\Scripts\python.exe" -m pip install "e:\Work\Dev\GitHub\CristiFati\Prebuilt-Binaries\pyo\v1.0.4\pyo-1.0.4-cp37-cp37m-win32.whl"
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Processing e:\work\dev\github\cristifati\prebuilt-binaries\pyo\v1.0.4\pyo-1.0.4-cp37-cp37m-win32.whl
Installing collected packages: pyo
Successfully installed pyo-1.0.4
WARNING: You are using pip version 20.3.3; however, version 22.2.2 is available.
You should consider upgrading via the 'e:\Work\Dev\VEnvs\py_pc032_03.07_test0\Scripts\python.exe -m pip install --upgrade pip' command.

[prompt]>
[prompt]> "e:\Work\Dev\VEnvs\py_pc032_03.07_test0\Scripts\python.exe" ./code00.py

WxPython is not found for the current python version.
Pyo will use a minimal GUI toolkit written with Tkinter (if available).
This toolkit has limited functionnalities and is no more
maintained or updated. If you want to use all of pyo's
GUI features, you should install WxPython, available here:
http://www.wxpython.org/

Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] 032bit on win32

Pyo warning: Portmidi closed.
Playing sound (Sine) for 2.000 seconds (and saving to 'Sine.wav') ...
Sample: < Instance of Sine class >
SFP: < Instance of SfPlayer class >

Done.

Answered By – CristiFati

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published