2016-08-13 495 views
1

我想使用「scikits.samplerate」,但安裝失敗。 我在使用Windows10(64位)的Python 3.51與Anaconda。安裝scikits.samplerate失敗

首先,我跟着這個指令: https://scikits.appspot.com/samplerate

>pip install scikits.samplerate Collecting scikits.samplerate Using cached scikits.samplerate-0.3.3.tar.gz 
    Complete output from command python setup.py egg_info: 
    SamplerateInfo: 
     libraries samplerate not found in c:\users\username\anaconda3\lib 
     libraries samplerate not found in C:\ 
     libraries samplerate not found in c:\users\username\anaconda3\libs 
    Traceback (most recent call last): 
     File "scikits\samplerate\setup.py", line 15, in configuration 
     sf_config = sf_info.get_info(2) 
     File "c:\users\username\anaconda3\lib\site-packages\numpy\distutils\system_info.py", line 568, 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\username\AppData\Local\Temp\pip-build-9sjnkaf5\scikits.samplerate\setup.py", line 74, in <module> 
     classifiers = CLASSIFIERS, 
     File "c:\users\username\anaconda3\lib\site-packages\numpy\distutils\core.py", line 135, in setup 
     config = configuration() 
     File "C:\Users\username\AppData\Local\Temp\pip-build-9sjnkaf5\scikits.samplerate\setup.py", line 59, in configuration 
     config.add_subpackage(DISTNAME) 
     File "c:\users\username\anaconda3\lib\site-packages\numpy\distutils\misc_util.py", line 1002, in add_subpackage 
     caller_level = 2) 
     File "c:\users\username\anaconda3\lib\site-packages\numpy\distutils\misc_util.py", line 971, in get_subpackage 
     caller_level = caller_level + 1) 
     File "c:\users\username\anaconda3\lib\site-packages\numpy\distutils\misc_util.py", line 908, in _get_configuration_from_setup_py 
     config = setup_module.configuration(*args) 
     File "scikits\samplerate\setup.py", line 20, in configuration 
     [samplerate].""") 
    numpy.distutils.system_info.NotFoundError: SRC (http://www.mega-nerd.com/SRC/) library not found. Directories to search 
    for the libraries can be specified in the site.cfg file, in section 
    [samplerate]. 

    ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in C:\Users\username\AppData\Local\Temp\pip-build-9sjnkaf5\scikits.samplerate\ 

......接下來,我跟着這個指令: https://anaconda.org/hcc/scikits.samplerate

>conda install -c hcc scikits.samplerate=0.3.3 Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata: ...... Solving package specifications: . Error: Package missing in current win-64 channels: 
    - scikits.samplerate 0.3.3* 

You can search for this package on anaconda.org with 

    anaconda search -t conda scikits.samplerate 0.3.3* 

...所以,我serached:

[Anaconda3] C:\Users\username>anaconda search -t conda scikits↲ Using Anaconda Cloud api site https://api.anaconda.org↲ Run 'anaconda show <USER/PACKAGE>' to get more details:↲ Packages:↲ 
    Name      | Version | Package Types | Platforms↲ 
    ------------------------- | ------ | --------------- | ---------------↲ 
    HCC/scikits.samplerate | 0.3.3 | conda   | linux-64↲ 
              : A python module for high quality audio resampling↲ 
    anaconda/scikits-image | 0.7.1 | conda   | linux-64, win-32, win-64, linux-32, osx-64↲ 
    davidbgonzalez/scikits.talkbox | 0.2.5 | conda   | linux-64↲ 
    desilinguist/scikits-bootstrap | 0.3.1 | conda   | linux-64, osx-64↲ 
    krisvanneste/scikits.timeseries | 0.91.3 | conda   | win-64↲ 
    lukepfister/scikits.cuda | master_2016.2 | conda   | linux-64↲ 
              : Python interface to GPU-powered libraries↲ 
    menpo/scikits.sparse  |  0.2 | conda   | linux-64, osx-64↲ 
    miguelalexanderdiaz/scikits.cuda | 0.5.0b1 | conda   | linux-64↲ 
              : Python interface to GPU-powered libraries↲ 
    poppy-project/scikits.samplerate | 0.3.3 | conda   | linux-armv7l↲ 
              : Simple Hamming Marker Detection using OpenCV↲ 
    rgrout/scikits.bootstrap | 0.3.2 | conda   | linux-64, osx-64↲ 
              : Bootstrap confidence interval estimation routines for SciPy.↲ Found 10 packages↲ ↲ [Anaconda3] C:\Users\username>anaconda show poppy-project/scikits.samplerate↲ Using Anaconda Cloud api site https://api.anaconda.org↲ Name: scikits.samplerate↲ Summary: Simple Hamming Marker Detection using OpenCV↲ Access: public↲ Package Types: conda↲ Versions:↲ + 0.3.3↲ ↲ To install this package with conda run:↲ 
    conda install --channel https://conda.anaconda.org/poppy-project scikits.samplerate↲ ↲ [Anaconda3] C:\Users\username>conda install 
--channel https://conda.anaconda.org/poppy-project scikits.samplerate↲ Using Anaconda Cloud api site https://api.anaconda.org↲ Fetching package metadata: ......↲ Solving package specifications: .↲ Error: Package missing in current win-64 channels:↲ 
    - scikits.samplerate↲ ↲ You can search for this package on anaconda.org with↲ ↲ 
    anaconda search -t conda scikits.samplerate↲ 

...我已經完成我被告知,但仍然失敗。 有沒有人有解決方案? 這是真的可以安裝嗎?

+1

我認爲這是有關到https:// github上。 com/cournape/samplerate/issues/8 – Erik

回答

4

我不確定這是否可行,但如果確實如此,則很高興。您是否嘗試過編輯site.cfg文件並再次嘗試安裝。這是您問題中的第20行錯誤。

這裏的用戶已經在Ubuntu上完成了它,也許類似的方法也適用於Windows。

http://msnoise.org/doc/installation.html

You first need to install the SRC library: 

sudo apt-get install libsamplerate0 libsamplerate0-dev 
This python package will probably be the most tricky to install. If you are lucky, you can just 

pip install scikits.samplerate 
On my Ubuntu 12.04, this results in an error because the SRC library path is not found. The reason is that the setup searches SRC in /usr/lib and not in /usr/lib/x86_64-linux-gnu where the library is actually present. To install, you need to download the archive from pypi and edit some configuration file: 

wget https://pypi.python.org/packages/source/s/scikits.samplerate/scikits.samplerate-0.3.3.tar.gz#md5=96c8d8ba3aa95a9db15994f78792efb4 
tar -xvf scikits.samplerate-0.3.3.tar.gz 
cd scikits.samplerate-0.3.3 
then edit the site.cfg example file and insert the following lines: 

[samplerate] 
library_dirs=/usr/lib/x86_64-linux-gnu 
include_dirs=/usr/include 
To know where the SRC library is on you machine: 

sudo dpkg -L libsamplerate0 
sudo dpkg -L libsamplerate0-dev 
then, build and install: 

python setup.py build 
python setup.py install 
+0

不幸的是,這些信息還不夠。 我從https://pypi.python.org/pypi/scikits.samplerate下載了「scikits.samplerate-0.3.3.tar.gz」。提取tar並將其放在C:\ Users \ username \ Anaconda3 \ pkgs下(我不確定這是否正確)。如你所說,我修改了「site.cfg.example」。 但是,因爲我沒有使用Ubuntu,所以沒有dpkg命令。看來Ubuntu的解決方案不能成爲Windows的解決方案。謝謝,不過。 – IanHacker

+0

我假設你用文件資源管理器導航到SRC庫的路徑(相當於查找路徑的窗口),然後用Windows格式C:\ users \ Program files x 86 \ anaconda \ lib(或類似的路徑)而不是使用示例中的那個。對不起,它沒有解決。 – Jeeth

0

首先,請注意我用的UNIX系統,而不是Windows。

我有相同/相似的錯誤:

...numpy.distutils.system_info.NotFoundError: SRC (http://www.mega-nerd.com/SRC/) library not found. Directories to search for the libraries can be specified in the site.cfg file, in section...

我跟着它給出的鏈接,找到下載站點: http://www.mega-nerd.com/SRC/download.html

  • 下載的源代碼,
  • 編譯並安裝它們
  • 然後只是安裝scikits.samplerate使用pip

在Windows它可能會更加困難(我還沒有嘗試過!),但該網站上有對指令的鏈接的Windows:http://www.mega-nerd.com/SRC/win32.html

+0

感謝您試圖幫助我,但同樣,Linux解決方案不能成爲Windows解決方案。我已經嘗試過了(用Visual Studio C++編譯源代碼),它根本不起作用。請檢查此作者的個人資料。他是一個真正的Windows用戶。他沒有故意編譯Windows版本。他要錢來編譯Windows,但沒有說多少就足夠了。如果我們付出更多,他會更加努力。而已。我不再需要這個廢話了。 – IanHacker