AudioOwl
AudioOwl copied to clipboard
cython missing?
I tried to install in windows python 3.10 conda env and encountered error below. After "pip install cython" the error went away. Maybe update installation instructions, or add to requirements.txt? But then the pip install audioowl failed with error below
Thanks!
F:\tobi\envs\CartPoleSimulation3\include\cpython/pystate.h(60): note: see declaration of '_ts'
madmom/ml/nn/layers.c(18881): error C2039: 'exc_traceback': is not a member of '_ts'
F:\tobi\envs\CartPoleSimulation3\include\cpython/pystate.h(60): note: see declaration of '_ts'
madmom/ml/nn/layers.c(19872): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
madmom/ml/nn/layers.c(19878): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> madmom
I am getting the same problem, did you manage to solve it?
You can simply install it:
pip install Cython numpy
Packet maintainer has to add this to the list of required packages
But then I get compilation errors for madmom
with Python 3.11 see also #11 and https://github.com/cython/cython/pull/4428
So if I try python3.10 Cython is missing even if it is installed as a python package.
ModuleNotFoundError: No module named 'Cython'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
cython is already the newest version (0.29.14-1).
This is a viable option for use AudioOwl on windows without wsl.
The first thing is that madmom has poor compatibility with MSBuild, so it may be can compiled with mingw64 as a compiler
Tested in py3.6, it should work in 37, but 38 is not clear, and 39 and above will fail (we'll describe why at the end).
1. Prepare the compilation environment
Go to Google and find the mingw32-w64 build, download it and throw it on your hard disk, then add {path to mingw32-w64}/bin to the path of your system environment variable. Then open a new powershell/cmd and type gcc --verison to make sure the environment variable is working.
Then update your setuptools and wheel, and make sure you have cython installation
pip install --upgrade setuptools wheel cython
2. Building madmom
build preparation
According to https://github.com/CPJKU/madmom:
git clone https://github.com/CPJKU/madmom
cd madmom
git submodule update --init --remote
Then do a version switch
git checkout v0.15.1
build & package
python setup.py build -c mingw32 # -c is responsible for specifying mingw32 as the compiler, setuptools will automatically look for the appropriate gcc
python setup.py bdist_wheel
install
pip install dist/madmom-0.15.1-cp36-cp36m-win_amd64.whl
Different python versions will have different names, just copy the filename.
3. The next step is to build and install audioOwl, which is a similar process.
git clone https://github.com/dodiku/AudioOwl
cd AudioOwl
python setup.py build -c mingw32
python setup.py bdist_wheel
pip install dist/audioowl-0.0.14-py3-none-any.whl
And AudioOwl should be working now.
For an analysis of why higher versions of python fail
I've spent a lot of time testing the high version of python and it fails. The reason should be that madmom's code is old and not suitable for high version python and numpy which can be applied to high version.
I managed to compile it in two ways, but without exception, it compiled successful and reported errors during execution. The first way is to use mingw in linux to cross-compile for Windows X64. The second way is to use mingw to compile on Windows as described above. Of course, it should not be a problem with the compilation method, but the code is not suitable for the higher version, after all, one was updated 2 years ago and the other 5 years ago, when installing directly to the higher version of python in Linux, the compilation is pip itself successful, but obviously there are problems in the use of it.