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] Fail to install (with python 3.10.13) #888

Open
joyboy67 opened this issue Dec 27, 2023 · 7 comments
Open

[Bug] Fail to install (with python 3.10.13) #888

joyboy67 opened this issue Dec 27, 2023 · 7 comments
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@joyboy67
Copy link

  • [ x] I didn't find a similar issue already open.
  • [ x] I read the documentation (README AND Wiki)
  • [ x] I have installed FFMpeg
  • [ x] My problem is related to Spleeter only, not a derivative product (such as Webapplication, or GUI provided by others)

Description

Fail to install spleeter on OpenBSD 7.3 with python 3.10.13

Step to reproduce

  1. Installed using doas pip install spleeter
  2. Run as user
  3. Got RuntimeError: Running cythonize failed! error

Output

$ doas pip install spleeter
Collecting spleeter
  Using cached spleeter-2.4.0-py3-none-any.whl.metadata (10 kB)
Collecting ffmpeg-python<0.3.0,>=0.2.0 (from spleeter)
  Using cached ffmpeg_python-0.2.0-py3-none-any.whl (25 kB)
Collecting httpx<0.20.0,>=0.19.0 (from httpx[http2]<0.20.0,>=0.19.0->spleeter)
  Using cached httpx-0.19.0-py3-none-any.whl (77 kB)
Collecting norbert<0.3.0,>=0.2.1 (from spleeter)
  Using cached norbert-0.2.1-py2.py3-none-any.whl (11 kB)
Collecting pandas<2.0.0,>=1.3.0 (from spleeter)
  Using cached pandas-1.5.3.tar.gz (5.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
INFO: pip is looking at multiple versions of spleeter to determine which version is compatible with other requirements. This could take a while.
Collecting spleeter
  Using cached spleeter-2.3.2-py3-none-any.whl (51 kB)
Collecting librosa<0.9.0,>=0.8.0 (from spleeter)
  Using cached librosa-0.8.1-py3-none-any.whl (203 kB)
Collecting llvmlite<0.39.0,>=0.38.0 (from spleeter)
  Using cached llvmlite-0.38.1.tar.gz (129 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy<2.0.0,>=1.19.2 in /usr/local/lib/python3.10/site-packages (from spleeter) (1.24.1)
Collecting protobuf<4.0.0,>=3.19.4 (from spleeter)
  Using cached protobuf-3.20.3-py2.py3-none-any.whl (162 kB)
Collecting spleeter
  Using cached spleeter-2.1.0-py3-none-any.whl (50 kB)
Collecting httpx<0.17.0,>=0.16.1 (from httpx[http2]<0.17.0,>=0.16.1->spleeter)
  Using cached httpx-0.16.1-py3-none-any.whl (65 kB)
Collecting librosa==0.8.0 (from spleeter)
  Using cached librosa-0.8.0.tar.gz (183 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting numpy<1.19.0,>=1.16.0 (from spleeter)
  Using cached numpy-1.18.5.zip (5.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      Running from numpy source directory.
      <string>:461: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      /tmp/pip-install-160agpme/numpy_c7f3ff26f1da4e2d8168426e85d6169b/tools/cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        required_version = LooseVersion('0.29.14')
      /tmp/pip-install-160agpme/numpy_c7f3ff26f1da4e2d8168426e85d6169b/tools/cythonize.py:77: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cython_version) < required_version:
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              for i in range(1, RK_STATE_LEN):
                  self.rng_state.key[i] = val[i]
              self.rng_state.pos = i
      
              self._bitgen.state = &self.rng_state
              self._bitgen.next_uint64 = &mt19937_uint64
                                         ^
      ------------------------------------------------------------
      
      _mt19937.pyx:138:35: Cannot assign type 'uint64_t (*)(void *) except? -1 nogil' to 'uint64_t (*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'uint64_t (void *) except? -1 nogil'.
      Processing numpy/random/_bounded_integers.pxd.in
      Processing numpy/random/_mt19937.pyx
      Traceback (most recent call last):
        File "/tmp/pip-install-160agpme/numpy_c7f3ff26f1da4e2d8168426e85d6169b/tools/cythonize.py", line 238, in <module>
          main()
        File "/tmp/pip-install-160agpme/numpy_c7f3ff26f1da4e2d8168426e85d6169b/tools/cythonize.py", line 234, in main
          find_process_files(root_dir)
        File "/tmp/pip-install-160agpme/numpy_c7f3ff26f1da4e2d8168426e85d6169b/tools/cythonize.py", line 225, in find_process_files
          process(root_dir, fromfile, tofile, function, hash_db)
        File "/tmp/pip-install-160agpme/numpy_c7f3ff26f1da4e2d8168426e85d6169b/tools/cythonize.py", line 191, in process
          processor_function(fromfile, tofile)
        File "/tmp/pip-install-160agpme/numpy_c7f3ff26f1da4e2d8168426e85d6169b/tools/cythonize.py", line 80, in process_pyx
          subprocess.check_call(
        File "/usr/local/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/usr/local/bin/python3.10', '-m', 'cython', '-3', '--fast-fail', '-o', '_mt19937.c', '_mt19937.pyx']' returned non-zero exit status 1.
      Cythonizing sources
      Traceback (most recent call last):
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/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 "/usr/local/lib/python3.10/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 "/tmp/pip-build-env-ofqlbmfo/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 366, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/tmp/pip-build-env-ofqlbmfo/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-ofqlbmfo/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 488, in <module>
        File "<string>", line 469, in setup_package
        File "<string>", line 275, in generate_cython
      RuntimeError: Running cythonize failed!
      [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.

Environment

OS OpenBSD 7.3
Installation type pip
RAM available 23Go
Hardware spec GPU : none CPU : Intel i5

Additional context

@joyboy67 joyboy67 added bug Something isn't working invalid This doesn't seem right labels Dec 27, 2023
@3ternal
Copy link

3ternal commented Dec 28, 2023

Same problem here. I couldn't figure it out, but I got it working on Docker.

@EvergreenTheTree
Copy link

EvergreenTheTree commented Jan 12, 2024

After some trying it seems like the latest release of Spleeter on PyPI depends on a version of numpy that will not compile with Python 3.10. It looks like this was fixed in commit e46aebf but it has not been included in a release of Spleeter on PyPI (yet). It appears to install fine using Python 3.8 (which you can use pyenv to install in a convenient way).

@jocastrocUnal
Copy link

Same problem here

@thelabcat
Copy link

thelabcat commented Aug 11, 2024

@joyboy67 the "invalid" tag is to say that this issue is invalid. Please remove it. You've basically labeled this as an erroneous report and asked devs to not look into it.

This most certainly is a valid issue that I too am encountering.

@xuzhang12
Copy link

xuzhang12 commented Sep 17, 2024

I’m not familiar with your operating system, but I’m using Windows. The installation failure I encountered was due to dependency issues. It seems that Python 3.8 is a relatively acceptable version at the moment. My final solution was to completely uninstall the environment and create a new one with Python 3.8. In this new environment, run the following commands in sequence: 11.conda install -c conda-forge ffmpeg libsndfile, then 22.pip install spleeter. Be sure not to use mirrors to speed up the process, as this can lead to dependency incompatibility issues. Because the mirror files may not be consistent with the official files.If possible, use a VPN proxy for faster speeds. At this point, the environment should generally be ready. You can then test it by running 33.wget https://github.com/deezer/spleeter/raw/master/audio_example.mp3 and 44.spleeter separate -p spleeter:2stems -o output audio_example.mp3 to verify that the setup is successful. The audio_example.mp3 file can also be downloaded manually if the command-line download fails. Additionally, spleeter:2stems needs to be downloaded the first time it is used. If you have trouble downloading it, you can manually download it from https://github.com/deezer/spleeter/releases/download/v1.4.0/2stems.tar.gz, extract it, and place it in the pretrained_models folder so that Spleeter can find it.

@Astronaut323
Copy link

我不熟悉你的操作系统,但我使用的是Windows。我遇到的安装失败是由于依赖项问题。目前看来Python 3.8是一个相对可以接受的版本。我最终的解决方案是完全卸载环境,并使用 Python 3.8 创建一个新的环境。在这个新环境中,依次运行以下命令: 1 1.conda install -c conda-forge ffmpeg libsndfile,然后 2 2.pip install spleeter。使用镜像来加速该过程,因为这可能会导致依赖项不兼容的问题。因为镜像文件可能与官方文件不一致。如果可以,请使用VPN代理认为更快的速度。至此,环境一般应该已经准备好了。然后可以通过运行33.wget https://github.com/deezer/spleeter/raw/master/audio_example.mp3和4进行测试4.spleeter separate -p spleeter:2stems -o output audio_example.mp3,验证是否设置成功。如果命令行下载失败,也可以手动下载audio_example.mp3文件。另外,第一次使用时需要下载spleeter:2stems。如果您在下载时遇到问题,您可以从https://github.com/deezer/spleeter/releases/download/ v1. 4.0/2stems.tar.gz手动下载,提取并放在 pretrained_models 文件夹中,以便 Spleeter 可以找到它。

你好,请问你有遇到这种问题吗?
AssertionError: Nesting violated for default stack of <class 'tensorflow.python.framework.ops.Graph'> objects

@xuzhang12
Copy link

我不熟悉你的操作系统,但我使用的是Windows。我遇到的安装失败是由于依赖项问题。目前看来Python 3.8是一个相对可以接受的版本。我最终的解决方案是完全卸载环境,并使用 Python 3.8 创建一个新的环境。在这个新环境中,依次运行以下命令: 1 ,然后 2 。使用镜像来加速该过程,因为这可能会导致依赖项不兼容的问题。因为镜像文件可能与官方文件不一致。如果可以,请使用VPN代理认为更快的速度。至此,环境一般应该已经准备好了。然后可以通过运行3和4进行测试,验证是否设置成功。如果命令行下载失败,也可以手动下载audio_example.mp3文件。另外,第一次使用时需要下载spleeter:2stems。如果您在下载时遇到问题,您可以从 https://github.com/deezer/spleeter/releases/download/ v1. 4.0/2stems.tar.gz手动下载,提取并放在 pretrained_models 文件夹中,以便 Spleeter 可以找到它。1.conda install -c conda-forge ffmpeg libsndfile``2.pip install spleeter``3.wget https://github.com/deezer/spleeter/raw/master/audio_example.mp3``4.spleeter separate -p spleeter:2stems -o output audio_example.mp3

你好,请问你有遇到这种问题吗?AssertionError: Nesting violated for default stack of <class 'tensorflow.python.framework.ops.Graph'> 对象

不好意思我并没有遇到过类似的问题,但是或许你可以问一下gpt是什么情况

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

7 participants