bmcfee / resampy

Efficient sample rate conversion in python
https://resampy.readthedocs.io
ISC License
253 stars 36 forks source link

Installation via bdist_wheel and bdist_egg can't find resampy/interp.c #18

Closed mmcauliffe closed 8 years ago

mmcauliffe commented 8 years ago

I've had a couple of issues installing resampy when trying to install librosa, with errors similar to the following:

Searching for resampy>=0.1.0
Reading https://pypi.python.org/simple/resampy/
Best match: resampy 0.1.0
Downloading https://pypi.python.org/packages/e1/8d/9fbc8e1dba8a83e4be47cc4a906dcb3ca5959bc7e4da1d388e64c2d20a5e/resampy-0.1.0.tar.gz#md5=3fec740b9dcc40397efd4d1b4e4ad532
Processing resampy-0.1.0.tar.gz
Writing /tmp/easy_install-_2lda2x_/resampy-0.1.0/setup.cfg
Running resampy-0.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_2lda2x_/resampy-0.1.0/egg-dist-tmp-14darseq
warning: no files found matching '*.pxd' under directory 'resampy'
gcc: error: resampy/interp.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.

In general, this can be worked around by doing pip install resampy which gives similar errors about missing resampy/interp.c during bdist_wheel, but then falls back on installing via setup.py install, something like (on windows):

>pip install resampy
Collecting resampy
  Downloading resampy-0.1.0.tar.gz (320kB)
    100% |████████████████████████████████| 327kB 101kB/s 
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.10 in c:\miniconda3\envs\sct\lib\site-packages (from resampy)
Requirement already satisfied (use --upgrade to upgrade): scipy>=0.13 in c:\miniconda3\envs\sct\lib\site-packages (from resampy)
Requirement already satisfied (use --upgrade to upgrade): six>=1.3 in c:\miniconda3\envs\sct\lib\site-packages (from resampy)
Collecting Cython>=0.21 (from resampy)
  Downloading Cython-0.24-cp35-none-win_amd64.whl (1.9MB)
    100% |████████████████████████████████| 1.9MB 433kB/s 
Building wheels for collected packages: resampy
  Running setup.py bdist_wheel for resampy ... error
  Complete output from command C:\Miniconda3\envs\sct\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\michael\\AppData\\Local\\Temp\\pip-build-7wr0ovfk\\resampy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\michael\AppData\Local\Temp\tmpmu8ren92pip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.5
  creating build\lib.win-amd64-3.5\resampy
  copying resampy\core.py -> build\lib.win-amd64-3.5\resampy
  copying resampy\filters.py -> build\lib.win-amd64-3.5\resampy
  copying resampy\version.py -> build\lib.win-amd64-3.5\resampy
  copying resampy\__init__.py -> build\lib.win-amd64-3.5\resampy
  creating build\lib.win-amd64-3.5\resampy\data
  copying resampy\data\kaiser_best.npz -> build\lib.win-amd64-3.5\resampy\data
  copying resampy\data\kaiser_fast.npz -> build\lib.win-amd64-3.5\resampy\data
  running build_ext
  building 'resampy.interp' extension
  creating build\temp.win-amd64-3.5
  creating build\temp.win-amd64-3.5\Release
  creating build\temp.win-amd64-3.5\Release\resampy
  D:\Dev\VS\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Miniconda3\envs\sct\lib\site-packages\numpy\core\include -IC:\Miniconda3\envs\sct\include -IC:\Miniconda3\envs\sct\include -ID:\Dev\VS\VC\INCLUDE -ID:\Dev\VS\VC\ATLMFC\INCLUDE "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt" -ID:\Dev\VS\VC\include "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\ucrt" /Tcresampy/interp.c /Fobuild\temp.win-amd64-3.5\Release\resampy/interp.obj
  interp.c
  c1: fatal error C1083: Cannot open source file: 'resampy/interp.c': No such file or directory
  error: command 'D:\\Dev\\VS\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for resampy
  Running setup.py clean for resampy
Failed to build resampy
Installing collected packages: Cython, resampy
  Running setup.py install for resampy ... done
Successfully installed Cython-0.24 resampy-0.1.0

Let me know if you need any further info from me.

bmcfee commented 8 years ago

Thanks for reporting this. It seems strange that a direct pip install works but not when it's installed as a dependency.

I'll look into it.

comex commented 8 years ago

I got the same error on OS X even by running setup.py manually, when I did not have Cython installed:

% python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to resampy.egg-info/requires.txt
writing resampy.egg-info/PKG-INFO
writing top-level names to resampy.egg-info/top_level.txt
writing dependency_links to resampy.egg-info/dependency_links.txt
reading manifest file 'resampy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.pxd' under directory 'resampy'
writing manifest file 'resampy.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.10-x86_64/egg
running install_lib
running build_py
running build_ext
building 'resampy.interp' extension
clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c resampy/interp.c -o build/temp.macosx-10.10-x86_64-2.7/resampy/interp.o
clang: error: no such file or directory: 'resampy/interp.c'
clang: error: no input files
error: command 'clang' failed with exit status 1

After installing it, the message changed:

% python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to resampy.egg-info/requires.txt
writing resampy.egg-info/PKG-INFO
writing top-level names to resampy.egg-info/top_level.txt
writing dependency_links to resampy.egg-info/dependency_links.txt
reading manifest file 'resampy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.pxd' under directory 'resampy'
writing manifest file 'resampy.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.10-x86_64/egg
running install_lib
running build_py
running build_ext
building 'resampy.interp' extension
error: unknown file type '.pyx' (from 'resampy/interp.pyx')

I was able to make it work by changing setup.py to use cythonize, though I'm not very familiar with Cython and don't know if this is the right thing to do.

bmcfee commented 8 years ago

Thanks @comex -- I'm also not all that experienced in shipping cython modules, but this was quite helpful.

bmcfee commented 8 years ago

This should be resolved now. Unfortunately, pypi went down while I was uploading the new release, so you might have to wait a bit before it's installable.

Khalidhussain1134 commented 7 years ago

Dear Sir, I have the same problem while installing librosa,

Collecting librosa
Requirement already satisfied: joblib>=0.7.0 in c:\python\lib\site-packages (from librosa)
Requirement already satisfied: numpy>=1.8.0 in c:\python\lib\site-packages (from librosa)
Requirement already satisfied: decorator>=3.0.0 in c:\python\lib\site-packages (from librosa)
Requirement already satisfied: scikit-learn>=0.14.0 in c:\python\lib\site-packages (from librosa)
Requirement already satisfied: audioread>=2.0.0 in c:\python\lib\site-packages (from librosa)
Collecting resampy>=0.1.2 (from librosa)
  Using cached resampy-0.1.5.tar.gz
Requirement already satisfied: scipy>=0.13.0 in c:\python\lib\site-packages (from librosa)
Requirement already satisfied: six>=1.3 in c:\python\lib\site-packages (from librosa)
Requirement already satisfied: Cython>=0.23 in c:\python\lib\site-packages (from resampy>=0.1.2->librosa)
Building wheels for collected packages: resampy
  Running setup.py bdist_wheel for resampy ... error
  Complete output from command C:\Python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\KHALID~1\\AppData\\Local\\Temp\\pip-build-rul5p_dh\\resampy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\KHALID~1\AppData\Local\Temp\tmpwf2gxa4lpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-3.6
  creating build\lib.win32-3.6\resampy
  copying resampy\core.py -> build\lib.win32-3.6\resampy
  copying resampy\filters.py -> build\lib.win32-3.6\resampy
  copying resampy\version.py -> build\lib.win32-3.6\resampy
  copying resampy\__init__.py -> build\lib.win32-3.6\resampy
  creating build\lib.win32-3.6\resampy\data
  copying resampy\data\kaiser_best.npz -> build\lib.win32-3.6\resampy\data
  copying resampy\data\kaiser_fast.npz -> build\lib.win32-3.6\resampy\data
  running build_ext
  building 'resampy.interp' extension
  error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

  ----------------------------------------
  Failed building wheel for resampy
  Running setup.py clean for resampy
Failed to build resampy
Installing collected packages: resampy, librosa
  Running setup.py install for resampy ... error
    Complete output from command C:\Python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\KHALID~1\\AppData\\Local\\Temp\\pip-build-rul5p_dh\\resampy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\KHALID~1\AppData\Local\Temp\pip-bmhdejmr-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.6
    creating build\lib.win32-3.6\resampy
    copying resampy\core.py -> build\lib.win32-3.6\resampy
    copying resampy\filters.py -> build\lib.win32-3.6\resampy
    copying resampy\version.py -> build\lib.win32-3.6\resampy
    copying resampy\__init__.py -> build\lib.win32-3.6\resampy
    creating build\lib.win32-3.6\resampy\data
    copying resampy\data\kaiser_best.npz -> build\lib.win32-3.6\resampy\data
    copying resampy\data\kaiser_fast.npz -> build\lib.win32-3.6\resampy\data
    running build_ext
    building 'resampy.interp' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    ----------------------------------------
Command "C:\Python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\KHALID~1\\AppData\\Local\\Temp\\pip-build-rul5p_dh\\resampy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\KHALID~1\AppData\Local\Temp\pip-bmhdejmr-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\KHALID~1\AppData\Local\Temp\pip-build-rul5p_dh\resampy\

So, I am first installing the resampy but it was not installing and giving the errors such as,

Collecting resampy
  Using cached resampy-0.1.5.tar.gz
Requirement already satisfied: numpy>=1.10 in c:\python\lib\site-packages (from resampy)
Requirement already satisfied: scipy>=0.13 in c:\python\lib\site-packages (from resampy)
Requirement already satisfied: six>=1.3 in c:\python\lib\site-packages (from resampy)
Requirement already satisfied: Cython>=0.23 in c:\python\lib\site-packages (from resampy)
Building wheels for collected packages: resampy
  Running setup.py bdist_wheel for resampy ... error
  Complete output from command C:\Python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\KHALID~1\\AppData\\Local\\Temp\\pip-build-_ntfrmif\\resampy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\KHALID~1\AppData\Local\Temp\tmpz6tep_ydpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-3.6
  creating build\lib.win32-3.6\resampy
  copying resampy\core.py -> build\lib.win32-3.6\resampy
  copying resampy\filters.py -> build\lib.win32-3.6\resampy
  copying resampy\version.py -> build\lib.win32-3.6\resampy
  copying resampy\__init__.py -> build\lib.win32-3.6\resampy
  creating build\lib.win32-3.6\resampy\data
  copying resampy\data\kaiser_best.npz -> build\lib.win32-3.6\resampy\data
  copying resampy\data\kaiser_fast.npz -> build\lib.win32-3.6\resampy\data
  running build_ext
  building 'resampy.interp' extension
  error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

  ----------------------------------------
  Failed building wheel for resampy
  Running setup.py clean for resampy
Failed to build resampy
Installing collected packages: resampy
  Running setup.py install for resampy ... error
    Complete output from command C:\Python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\KHALID~1\\AppData\\Local\\Temp\\pip-build-_ntfrmif\\resampy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\KHALID~1\AppData\Local\Temp\pip-02uxzvu1-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.6
    creating build\lib.win32-3.6\resampy
    copying resampy\core.py -> build\lib.win32-3.6\resampy
    copying resampy\filters.py -> build\lib.win32-3.6\resampy
    copying resampy\version.py -> build\lib.win32-3.6\resampy
    copying resampy\__init__.py -> build\lib.win32-3.6\resampy
    creating build\lib.win32-3.6\resampy\data
    copying resampy\data\kaiser_best.npz -> build\lib.win32-3.6\resampy\data
    copying resampy\data\kaiser_fast.npz -> build\lib.win32-3.6\resampy\data
    running build_ext
    building 'resampy.interp' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    ----------------------------------------
Command "C:\Python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\KHALID~1\\AppData\\Local\\Temp\\pip-build-_ntfrmif\\resampy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\KHALID~1\AppData\Local\Temp\pip-02uxzvu1-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\KHALID~1\AppData\Local\Temp\pip-build-_ntfrmif\resampy\

Please help me to fix the problem, thanks for your cooperation

bmcfee commented 7 years ago

Please help me to fix the problem, thanks for your cooperation

If you're going to build resampy from source, you need a C compiler:

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

If that's not feasible for you, I recommend going with the conda-forge package as described in the readme.

Khalidhussain1134 commented 7 years ago

I have installed Microsoft Visual C++ 15.0 but it was again giving the same error, image

Secondly when I tried with conda-forge, it was giving the error as mentioned below (C:\Anaconda) D:\DCASE2017-baseline-system-master>conda install -c conda-forge librosa=0.5.0 Fetching package metadata ............. Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict:

Please help me to solve this error,

bmcfee commented 7 years ago

UnsatisfiableError: The following specifications were found to be in conflict:

It looks like conda-forge is not yet building python 3.6 packages for librosa. I don't know what's going on there.

Conda-forge does have python 3.6 packages for resampy though, so conda install -c conda-forge resampy should work for you. You should then be able to pip install librosa.

Alternatively, if you can roll back your anaconda environment to python 3.5, everything should work out of the box.

Khalidhussain1134 commented 7 years ago

Dear Brain McFee, conda install -c conda-forge resampy is also not working,

(C:\Anaconda) D:\DCASE2017-baseline-system-master>conda install -c conda-forge resampy Fetching package metadata ............. Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict:

What should I do next your great favor is highly appreciable. Thank you

bmcfee commented 7 years ago

I recommend rolling back to a py3.5 environment for now.

Khalidhussain1134 commented 7 years ago

Dear Brain McFee, I have rolled back to py3.5 image

But still facing the error while installing resampy either by pip install resampy or conda install resampy here is the error screenshot

D:\DCASE2017-baseline-system-master\applications>pip install resampy
Collecting resampy
  Using cached resampy-0.1.5.tar.gz
Requirement already satisfied: numpy>=1.10 in c:\anaconda\lib\site-packages (from resampy)
Requirement already satisfied: scipy>=0.13 in c:\anaconda\lib\site-packages (from resampy)
Requirement already satisfied: six>=1.3 in c:\anaconda\lib\site-packages (from resampy)
Requirement already satisfied: Cython>=0.23 in c:\anaconda\lib\site-packages (from resampy)
Building wheels for collected packages: resampy
  **Running setup.py bdist_wheel for resampy ... error**
  Complete output from command C:\Anaconda\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\KHALID~1\\AppData\\Local\\Temp\\pip-build-mtg90fca\\resampy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\KHALID~1\AppData\Local\Temp\tmpjpi4bmg4pip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-3.5
  creating build\lib.win32-3.5\resampy
  copying resampy\core.py -> build\lib.win32-3.5\resampy
  copying resampy\filters.py -> build\lib.win32-3.5\resampy
  copying resampy\version.py -> build\lib.win32-3.5\resampy
  copying resampy\__init__.py -> build\lib.win32-3.5\resampy
  creating build\lib.win32-3.5\resampy\data
  copying resampy\data\kaiser_best.npz -> build\lib.win32-3.5\resampy\data
  copying resampy\data\kaiser_fast.npz -> build\lib.win32-3.5\resampy\data
  running build_ext
  building 'resampy.interp' extension
  **_error: [WinError 2] The system cannot find the file specified_**

  ----------------------------------------
  Failed building wheel for resampy
  Running setup.py clean for resampy
Failed to build resampy
Installing collected packages: resampy
  Running setup.py install for resampy ... error
    Complete output from command C:\Anaconda\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\KHALID~1\\AppData\\Local\\Temp\\pip-build-mtg90fca\\resampy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\KHALID~1\AppData\Local\Temp\pip-2696ee50-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.5
    creating build\lib.win32-3.5\resampy
    copying resampy\core.py -> build\lib.win32-3.5\resampy
    copying resampy\filters.py -> build\lib.win32-3.5\resampy
    copying resampy\version.py -> build\lib.win32-3.5\resampy
    copying resampy\__init__.py -> build\lib.win32-3.5\resampy
    creating build\lib.win32-3.5\resampy\data
    copying resampy\data\kaiser_best.npz -> build\lib.win32-3.5\resampy\data
    copying resampy\data\kaiser_fast.npz -> build\lib.win32-3.5\resampy\data
    running build_ext
    building 'resampy.interp' extension
    **error: [WinError 2] The system cannot find the file specified**

   Command "C:\Anaconda\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\KHALID~1\\AppData\\Local\\Temp\\pip-build-mtg90fca\\resampy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\KHALID~1\AppData\Local\Temp\pip-2696ee50-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\KHALID~1\AppData\Local\Temp\pip-build-mtg90fca\resampy\

Please help to solve the problem thanking you

bmcfee commented 7 years ago

How did conda installation fail in your 3.5 environment?

Khalidhussain1134 commented 7 years ago

Hi Brain McFee, I am very thankful to you for providing such precious help. Every thing is now fine with py3.5.0 after restarting the system.

On Tue, Apr 4, 2017 at 4:51 PM, Brian McFee notifications@github.com wrote:

How did conda installation fail in your 3.5 environment?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bmcfee/resampy/issues/18#issuecomment-291476633, or mute the thread https://github.com/notifications/unsubscribe-auth/AZkvZiKVNcNvzffNI_R8ZFKLr_q-L1AMks5rsi6zgaJpZM4Ijh7B .