Installing scikits.samplerate fails - python

I'd like to use "scikits.samplerate", but installation fails.
I'm using Windows10 (64 Bits) for Python 3.51 with Anaconda.
Firstly, I followed this instruction:
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\
... Next, I followed this instruction:
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*
... so, I 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↲
... I have done what I was told, but still it fails.
Does anyone have a solution?
Is this really installable?

I am not sure if this would work, but glad if it does. Have you tried to edit the site.cfg file and try the installation again.This is what line 20 error in your question says as well.
The user here has done it on Ubuntu, maybe a similar approach works for Windows as well.
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

Firstly, notice I used UNIX system, not Windows.
I had same/similar error:
...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...
I followed link given in it, found download site:
http://www.mega-nerd.com/SRC/download.html
downloaded sources,
compiled and installed them
then just installed scikits.samplerate using pip
In Windows it might be more difficult (i haven't tried it!), but on the site there is a link to instructions for Windows: http://www.mega-nerd.com/SRC/win32.html

For Centos7 when I had that error I did:
yum install libsamplerate-devel libsamplerate

For Windows I am using Miniconda2 and in order to get librosa to work installed ffmpeg using this command:
conda install -c conda-forge ffmpeg

Related

'/bin/convert_to_uff.py': No such file or directory

I am trying to optimize YoloV3 using tensorRT
I came this post called Have you Optimized your Deep Learning Model Before Deployment?
Docker is used in the post.
Used Enabling GPUs in the Container Runtime Ecosystem to install nvidia-docker2
Pulled the latest version of the docker image docker pull aminehy/tensorrt-opencv-python3:version-1.3 from aminehy/tensorrt-opencv-python3
Here are the images
$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nvcr.io/nvidia/cuda 10.1-cudnn7-devel-ubuntu18.04 b4879c167fc1 2 weeks ago 3.67GB
aminehy/tensorrt-opencv-python3 version-1.3 0302e477816d 4 months ago 5.36GB
aminehy/tensorrt-opencv-python3 latest 604502819d12 4 months ago 4.94GB
aminehy/tensorrt-opencv-python3 version-1.1 d693210c500c 4 months ago 4.94GB
I ran
$sudo docker run -it --rm -v $(pwd):/workspace --runtime=nvidia -w /workspace -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY aminehy/tensorrt-opencv-python3:version-1.3```
=====================
== NVIDIA TensorRT ==
=====================
NVIDIA Release 19.05 (build 6392482)
NVIDIA TensorRT 5.1.5 (c) 2016-2019, NVIDIA CORPORATION. All rights reserved.
Container image (c) 2019, NVIDIA CORPORATION. All rights reserved.
https://developer.nvidia.com/tensorrt
To install Python sample dependencies, run /opt/tensorrt/python/python_setup.sh
root#a38b20eeb740:/workspace# cd /opt/tensorrt/python/
root#a38b20eeb740:/opt/tensorrt/python# chmod +x python_setup.sh
root#a38b20eeb740:/opt/tensorrt/python# ./python_setup.sh
Requirement already satisfied: Pillow in /usr/local/lib/python3.5/dist-packages (from -r /opt/tensorrt/samples/sampleSSD/requirements.txt (line 1)) (6.0.0)
WARNING: You are using pip version 19.2.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Ignoring torch: markers 'python_version == "3.7"' don't match your environment
......
......
......
Setting up graphsurgeon-tf (5.1.5-1+cuda10.1) ...
Setting up uff-converter-tf (5.1.5-1+cuda10.1) ...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/uff/__init__.py", line 1, in <module>
from uff import converters, model # noqa
File "/usr/lib/python2.7/dist-packages/uff/model/__init__.py", line 1, in <module>
from . import uff_pb2 as uff_pb # noqa
File "/usr/lib/python2.7/dist-packages/uff/model/uff_pb2.py", line 6, in <module>
from google.protobuf.internal import enum_type_wrapper
ImportError: No module named google.protobuf.internal
chmod: cannot access '/bin/convert_to_uff.py': No such file or directory
Can't seem to find any file called convert_to_uff.py inside bin
Whats is going?
Where did I go wrong?
Try reinstalling protobuf to be sure:
pip install protobuf

Spyder: importerror: cannot import name constants

Ubuntu 16.04
Python 2.7
Anaconda 2
I have Anaconda2 installed. This includes the spyder IDE, according to google.
$ spyder
Gives:
Traceback (most recent call last):
File "/home/username/anaconda2/bin/spyder", line 7, in <module>
from spyder.app.start import main
File "/home/username/anaconda2/lib/python2.7/site-packages/spyder/app/start.py", line 13, in <module>
import zmq
File "/usr/lib/python2.7/dist-packages/zmq/__init__.py", line 66, in <module>
from zmq import backend
File "/usr/lib/python2.7/dist-packages/zmq/backend/__init__.py", line 40, in <module>
reraise(*exc_info)
File "/usr/lib/python2.7/dist-packages/zmq/backend/__init__.py", line 27, in <module>
_ns = select_backend(first)
File "/usr/lib/python2.7/dist-packages/zmq/backend/select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "/usr/lib/python2.7/dist-packages/zmq/backend/cython/__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: cannot import name constants
Doesn't work:
$ sudo apt-get purge spyder
$ sudo apt-get install spyder
Doesn't work:
$ conda uninstall spyder
$ conda install spyder
Googling the error doesn't help me along. I'm not a programmer. Python libraries and Anaconda directories and IDE repositories, are all Greek to me. Might be useful information for those who actually know how things work: importing scipy.io also gives me importerrors.
Where is the fault and how do I resolve it?
EDITS
$ conda update chardet
gives:
/home/pieter/anaconda2/lib/python2.7/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn't match a supported version!
RequestsDependencyWarning)
Solving environment: done
# All requested packages already installed.
and
$ conda update urllib3
gives:
/home/pieter/anaconda2/lib/python2.7/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn't match a supported version!
RequestsDependencyWarning)
Solving environment: done
# All requested packages already installed.
$ conda info spyder
gives:
absurdly long, long, long list of replies
of which the last is:
spyder 3.2.4 py27h04a3490_0
---------------------------
file name : spyder-3.2.4-py27h04a3490_0.tar.bz2
name : spyder
version : 3.2.4
build string: py27h04a3490_0
build number: 0
channel : https://repo.continuum.io/pkgs/main/linux-64
size : 2.5 MB
arch : None
constrains : ()
license : MIT
md5 : ed9729850ec1ab3c83d87b422e687bc5
platform : None
subdir : linux-64
timestamp : 1508356637551
url : https://repo.continuum.io/pkgs/main/linux-64/spyder-3.2.4-py27h04a3490_0.tar.bz2
dependencies:
chardet >=2.0
jedi >=0.9
nbconvert
numpydoc
pickleshare
psutil
pycodestyle
pyflakes
pygments >=2.0
pylint
pyqt
python >=2.7,<2.8.0a0
pyzmq
qtawesome >=0.4.1
qtconsole >=4.2
qtpy >=1.2.0
rope >=0.9.4
sphinx
myEnv:
(myEnv) pieter#t:~/bagfile_analysis$ spyder
Traceback (most recent call last):
File "/home/pieter/anaconda2/envs/myEnv/bin/spyder", line 4, in <module>
import re
File "/home/pieter/anaconda2/envs/myEnv/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Hmmm... have you tried THIS already?
Also, how exactly did you install spyder? Maybe you didn't install it in the right environemnt(in your case probably the default root/base environment)
I'd recommend installing it via conda in the terminal! Also make sure you have installed it in the right environment:
get a list of all your environments:
$ conda env list
install it in a specific environment:
$ conda install --name "your env" spyder
and of course make sure you got the latest anaconda version:
$ conda update -n base conda
EDIT
ok now we know you only have your base environment.
since chardet is a dependency of spyder let's update those two packages first to be sure...
$ conda update chardet
$ conda update urllib3
Let's go on and check your spyder.
Does it work now?
if not try this:
$ conda info spyder
what do you get?
you should get a very long list, but only the last entry is of importance, something like that:
spyder 3.2.5 py27_0
-------------------
file name : spyder-3.2.5-py27_0.tar.bz2
name : spyder
version : 3.2.5
build string: py27_0
build number: 0
channel : https://repo.continuum.io/pkgs/main/osx-64
size : 2.5 MB
arch : None
constrains : ()
license : MIT
md5 : 5ec8ffcda103c23c81005a5aed0c91e7
platform : None
subdir : osx-64
timestamp : 1514270782022
url : https://repo.continuum.io/pkgs/main/osx-64/spyder-3.2.5-py27_0.tar.bz2
dependencies:
chardet >=2.0
cloudpickle
jedi >=0.9
nbconvert
numpydoc
pickleshare
psutil
pycodestyle
pyflakes
pygments >=2.0
pylint
pyqt
python >=2.7,<2.8.0a0
python.app
pyzmq
qtawesome >=0.4.1
qtconsole >=4.2
qtpy >=1.2.0
rope >=0.9.4
sphinx
if you don't get anything back you have installed spyder in the wrong environment and you can skip step 1:
STEP 1:
uninstall spyder again.
$ conda uninstall spyder
STEP 2:
reinstall it
$ conda install spyder
EDIT II
Have you had a look at the link I posted?
the only other thing that comes is in my mind is trying a different environment (for example called "myEnv").
$ conda create --name myEnv spyder
then activate the environment and try to launch spyder. conda tells you how to activate the environment, but i guess it's the same as for mac os:
$ source activate myEnv
$ spyder
$ source deactivate
if that doesn't work you can remove the environment again.
$ conda remove --name myEnv *
In any case the dependency error is weird...

How to install vtk with gl2ps enabled using conda

I am using anaconda, and I've built vtk with conda using
conda install vtk
The default build of vtk is without gl2ps, and I want to know how can I build (or rather rebuild) vtk with gl2ps enabled using conda.
I am actually tring to execture this example code:
from mayavi import mlab
mlab.test_plot3d()
mlab.savefig(temp.eps)
but get the error
Saving as a vector PS/EPS/PDF/TeX file using GL2PS is either not supported by your version of VTK or you have not configured VTK to work with GL2PS -- read the documentation for the vtkGL2PSExporter class.
Thank You
EDIT
I downloaded the coda-recipes
git clone https://github.com/conda/conda-recipes.git
and even if I do not edit the files to include gl2ps
BUILD START: vtk-5.10.1-py27_1
Fetching package metadata: ......
Solving package specifications: .
The following packages will be downloaded:
package | build
---------------------------|-----------------
setuptools-13.0.2 | py27_0 435 KB
The following NEW packages will be INSTALLED:
cmake: 3.0.1-0
openssl: 1.0.1k-0
pip: 6.0.8-py27_0
python: 2.7.9-1
readline: 6.2-2
setuptools: 13.0.2-py27_0
sqlite: 3.8.4.1-0
system: 5.8-1
tk: 8.5.15-0
zlib: 1.2.8-0
Fetching packages ...
setuptools-13. 100% |######################################################################################################################################################################################| Time: 0:00:00 463.16 kB/s
Extracting packages ...
[ COMPLETE ] |########################################################################################################################################################################################################| 100%
Linking packages ...
[ COMPLETE ] |########################################################################################################################################################################################################| 100%
Source cache directory is: /home/users/user/anaconda/conda-bld/src_cache
Downloading source to cache: vtk-5.10.1.tar.gz
An unexpected error has occurred, please consider sending the
following traceback to the conda GitHub issue tracker at:
https://github.com/conda/conda-build/issues
Include the output of the command 'conda info' in your report.
Traceback (most recent call last):
File "/home/users/user/anaconda/bin/conda-build", line 5, in <module>
sys.exit(main())
File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/main_build.py", line 110, in main
args_func(args, p)
File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/main_build.py", line 308, in args_func
args.func(args, p)
File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/main_build.py", line 268, in execute
build.build(m, verbose=not args.quiet, post=post)
File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/build.py", line 304, in build
source.provide(m.path, m.get_section('source'))
File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/source.py", line 221, in provide
unpack(meta)
File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/source.py", line 60, in unpack
src_path = download_to_cache(meta)
File "/home/users/user/anaconda/lib/python2.7/site-packages/conda_build/source.py", line 48, in download_to_cache
download(meta['url'], path)
KeyError: 'url'
The recipe used to build vtk is here. You should modify it to include that package and build with with conda build vtk/.

How to install a binstar package in Anaconda?

I was unable to install -pdfminer- using the source distribution so I was trying to use binstar to do so. Since I am using the Ananconda distribution of Python, I type:
conda install -c https://conda.binstar.org/jacksongs pdfminer
but, get the following error:
Fetching package metadata: ...
Error: No packages found in current win-32 channels matching: pdfminer
You can search for this package on Binstar with
binstar search -t conda pdfminer
Could you please suggest a solution?
Thank you.
PS: binstar search -t conda pdfminer returns the following:
Run 'binstar show <USER/PACKAGE>' to get more details:
Packages:
Name | Access | Package Types | Summary
------------------------- | ------------ | --------------- | --------------------
auto/pdfminer3k | published | conda |
http://bitbucket.org/hsoft/pdfminer3k
jacksongs/pdfminer | public | conda | PDF parser and analyzer
Found 2 packages
This has probably got to do with the choice of platform. Binstar only has a package for OS X 64 whereas I am using windows.
I myself have never used the anaconda distribution of python but judging by the information you have given, have you tried
conda install -c http://bitbucket.org/hsoft/pdfminer3k
Like I said before, I've never used this distribution and I have near to no idea of the solutions you have tried.
I hope I helped,
~Bobbeh
I tried the following: (Anaconda Python 2.7 on Windows 10 64-bit)
This adds the conda-forge channel to your list of channels
conda config --add channels conda-forge
Installs pdfminer
conda install pdfminer
This was my source: conda-forge:pdfminer on github

lxml runtime error: Reason: Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0

I have a perplexing problem.
I have used mac version 10.9, anaconda 3.4.1, python 2.7.6.
Developing web application with python-amazon-product-api. i have overcome an obstacle about installing lxml, referencing clang error: unknown argument: '-mno-fused-madd' (python package installation failure).
But another runtime error happened.
Here is the output from webbrowser.
Exception Type: ImportError
Exception Value:
dlopen(/Users/User_Name/Documents/App_Name/lib/python2.7/site-packages/lxml/etree.so, 2): Library not loaded: libxml2.2.dylib
Referenced from: /Users/User_Name/Documents/App_Name/lib/python2.7/site-packages/lxml/etree.so
Reason: Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0
I'm not sure how to proceed and have searched here and elsewhere for this particular error.
This worked for me:
brew install libxml2
brew install libxslt
brew link libxml2 --force
brew link libxslt --force
If using conda, force a reinstall of lxml:
$ conda install -f lxml
Note that forcing a reinstall may have unforeseen consequences.
I first tried conda update lxml to no effect.
Then tried conda install lxml also to no effect (but that was a while ago and ymmv -- see comment).
I was having this same issue. I realized that during pip install for my web app, lxml was attempting the following:
"Building against libxml2/libxslt in the following directory: /Users/[me]/anaconda/lib"
Not 100% sure why, but once I removed the anaconda/bin from my system path in bash_profile (anaconda sticks it in there when installing) I was able to pip install lxml correctly. After which you should be able to re-add anaconda/bin to your system path without issue.
I get this to work by doing the following:
conda install libxml2
Consider using an alternative channel in conda.
$ anaconda search -t conda pyquery
Using anaconda-server api site https://api.anaconda.org
Run 'anaconda show <USER/PACKAGE>' to get more details:
Packages:
Name | Version | Package Types | Platforms
------------------------- | ------ | --------------- | ---------------
CS109/pyquery | 1.2.9 | conda | linux-64, win-32, win-64, linux-32, osx-64
: A jquery-like library for python
asmeurer/pyquery | 1.2.6 | conda | osx-64
: https://github.com/gawel/pyquery
auto/pyquery | 1.2.8 | conda | linux-64, linux-32, osx-64
: https://github.com/gawel/pyquery
dan_blanchard/pyquery | 1.2.6 | conda | linux-64
: https://github.com/gawel/pyquery
hargup/pyquery | | conda | None-None, linux-64
: A jquery-like library for python
meloncholy/pyquery | 1.2.9 | conda | linux-64
: A jquery-like library for python
mhworth/pyquery | 1.2.8 | conda | linux-64, osx-64
: A jquery-like library for python
nbsantos/pyquery | 1.2.9 | conda | osx-64
: A jquery-like library for python
pdrops/pyquery | 1.2.8 | conda | linux-64, osx-64
: A jquery-like library for python
ziebel/pyquery | 1.2.9 | conda | linux-64
: A jquery-like library for python
Found 10 packages
Then, picking a channel, do:
conda install pyquery -c CS109
I tried almost all approaches above and failed. What worked for me was commenting out the
export DYLD_LIBRARY_PATH=/usr/lib
in my bash profile. This line is added by the anaconda installer automatically.

Categories