How does one install scikits.audiolab 0.11.0 on Windows
Asked Answered
C

2

11

I am currently trying to install scikits.audiolab 0.11.0 for Python 3.5.4 on Windows 10 and it requires libsndfile from http://www.mega-nerd.com/libsndfile/. I have installed this into my conda virtual environment so that the file path looks like this:

C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\libs\libsndfile

I then edit the site.cfg file within

C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\Lib\site-packages\numpy\distutils

to read:

[sndfile]
library_dirs = C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\libs\libsndfile;C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\libs\libsndfile\lib
include_dirs = C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\libs\libsndfile;C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\libs\libsndfile\include
sndfile_libs = sndfile-1

I then activate my wavenet environment in anaconda prompt and type:

pip install scikits.audiolab==0.11.0

which gives the following error and Traceback:

(wavenet) C:\Windows>pip install scikits.audiolab==0.11.0
Collecting scikits.audiolab==0.11.0
    Using cached scikits.audiolab-0.11.0.tar.gz
        Complete output from command python setup.py egg_info:
        SndfileInfo:
            libraries sndfile not found in C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\libs\libsndfile
            libraries sndfile not found in C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\libs\libsndfile\lib
        Traceback (most recent call last):
            File "scikits\audiolab\pysndfile\setup.py", line 20, in configuration
              sf_config = sf_info.get_info(2)
            File "C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\lib\site-packages\numpy\distutils\system_info.py", line 578, in get_info
              raise self.notfounderror(self.notfounderror.__doc__)
        numpy.distutils.system_info.NotFoundError: Some third-party program or library is not found.

        During handling of the above exception, another exception occurred:

        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "C:\Users\MXJ719\AppData\Local\Temp\pip-build-bet3e29j\scikits.audiolab\setup.py", line 85, in <module>
            classifiers=CLASSIFIERS)
          File "C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\lib\site-packages\numpy\distutils\core.py", line 135, in setup
            config = configuration()
          File "C:\Users\MXJ719\AppData\Local\Temp\pip-build-bet3e29j\scikits.audiolab\setup.py", line 71, in configuration
            config.add_subpackage(DISTNAME)
          File "C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
            caller_level = 2)
          File "C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
            caller_level = caller_level + 1)
          File "C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
            config = setup_module.configuration(*args)
          File "scikits\audiolab\setup.py", line 10, in configuration
            confgr.add_subpackage('pysndfile')
          File "C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
            caller_level = 2)
          File "C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
            caller_level = caller_level + 1)
          File "C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
            config = setup_module.configuration(*args)
          File "scikits\audiolab\pysndfile\setup.py", line 25, in configuration
            site.cfg file, in section [sndfile].""")
numpy.distutils.system_info.NotFoundError: sndfile (http://www.mega-nerd.com/libsndfile/) library not found.
Directories to search for the libraries can be specified in the
site.cfg file, in section [sndfile].

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in 
C:\Users\MXJ719\AppData\Local\Temp\pip-build-bet3e29j\scikits.audiolab\

I would like to know why the installer cannot seem to "see" the libsndfile directory that I have given in the site.cfg file and be instructed on how I can fix this to install scikits.audiolab version 0.11.0

Carola answered 12/12, 2017 at 18:46 Comment(2)
There is an open github issue about it.Telecast
Yes I found this but unfortunately none of those solutions workedCarola
R
0

Remove "-1" from the sndfile library file names.

In your case:

  1. rename libsndfile-1.lib to libsndfile.lib
  2. rename libsndfile-1.def to libsndfile.def

These files are located in C:\Users\MXJ719\AppData\Local\Continuum\anaconda3\envs\wavenet\libs\libsndfile\lib.

I had the same issue with sndfile installed in C:\Program Files\Mega-Nerd\libsndfile\.

My C:\Users\[userNameHere]\site.cfg file has the following content:

[sndfile]
library_dirs = C:\Program Files\Mega-Nerd\libsndfile\lib\
include_dirs = C:\Program Files\Mega-Nerd\libsndfile\include\

(defining sndfile_libs had no apparent effect for me, so I left it out.)

Hopefully that is enough for you. I run into other issues after solving this but I'll try to get help at https://github.com/cournape/audiolab/issues/7

Rojas answered 17/7, 2018 at 10:27 Comment(0)
B
0

if your problem just the sndfile, you only need making a setting configuration of site.cfg

the form in site.cfg.example is like this:

[sndfile]
include_dirs = c:\local\include
library_dirs = c:\local\lib
sndfile_libs = sndfile-1

change it with 2 optional condition:

******first method******

rename your libsndfile library (*.lib), base on the variabel that set in site.cfg,

[sndfile]
    include_dirs = C:\Program Files\Mega-Nerd\libsndfile\include
    library_dirs = C:\Program Files\Mega-Nerd\libsndfile\lib

    #and you must really give an attention to the setting code below, if you put the setting like the original, setting like this script below

    sndfile_libs = sndfile-1

    #so all your file must in folder include_dirs should be renamed to: sndfile-1.h, sndfile-1.hh (in include folder) 
    #and renamed the lib file in library_dirs to: sndfile-1.lib and sndfile-1.lib

after that you must be make sure the lib is in your PYTHONPATH, if you don't have setting the PYTHONPATH, make it with:

System Properties >> Environtment Variables >> System Variables >>> New

input PYTHONPATH in New System Variable >> Variable Name

input your include, lib and bin libsndfile path dir to Variable Value, example:

'YOUR PYTHON FOLDER that have python.exe'; 'YOUR PYTHON SCRIPT FOLDER';C:\Program Files\Mega-Nerd\libsndfile\lib;C:\Program Files\Mega-Nerd\libsndfile\include;C:\Program Files\Mega-Nerd\libsndfile\bin

then press OK

after that you should input the PYTHONPATH to Path

just edit your Path variabel name and add new line with %PYTHONPATH%

if you already set / have the PYTHONPATH environtment set, just add edit and add new line with

C:\Program Files\Mega-Nerd\libsndfile\lib;C:\Program Files\Mega-Nerd\libsndfile\include;C:\Program Files\Mega-Nerd\libsndfile\bin

or use the:

*****second method*****,

set the file site.cfg to your python directory

[sndfile]
include_dirs = c:\users\admin\appdata\local\programs\python\python37\include
library_dirs = c:\users\admin\appdata\local\programs\python\python37\libs
sndfile_libs = 'change this base with your libsndfile's library name 
#so, you don't have to make many step

with this setting, my python can identify the libsndfile location

in my case, another module required libsndfile library too, which search the library with different name, so in my python folder, I copy the libsndfile into several name, depend how the module search that library.

Bandog answered 5/5, 2019 at 11:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.