How to install vtk with gl2ps enabled using conda - python

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/.

Related

Conda gives InvalidArchiveError for qt6-main - seeking backwards is not allowed

I'm trying to install PySide6, which requires qt6-main, using Conda. During the install using the command
conda install qt6-main -c conda-forge
I get the error:
InvalidArchiveError('Error with archive C:\\Users\\Username\\Anaconda3\\pkgs\\qt6-main-6.4.2-hc84ccb7_3.conda. You probably need to delete and re-download or re-create this file. Message was:\n\nfailed with error: seeking backwards is not allowed')
I have tried and this happens for versions 6.4.2 to 6.4.0. Is this a problem with Conda, with the archive or with something else?
I was getting the same error, before uninstalling/reinstalling(and updating) Anaconda3.
Now, I'm getting something different, but still with the same "smell":
(base)
capnf#DESKTOP-G84ND7C MINGW64 ~/Documents/GitHub/PyBERT (master)
$ conda build --python=3.9 --numpy=1.23 -c dbanas -c defaults -c conda-forge conda.recipe/pybert/
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Adding in variants from config.variant
INFO:conda_build.variants:Adding in variants from config.variant
Attempting to finalize metadata for pybert
INFO:conda_build.metadata:Attempting to finalize metadata for pybert
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
INFO:C:\Users\capnf\anaconda3\lib\site-packages\conda_package_handling\utils.py:rm_rf failed for C:\Users\capnf\anaconda3\pkgs\python-3.9.16-h6244533_0\.cph_tmphkgup82v
INFO:C:\Users\capnf\anaconda3\lib\site-packages\conda_package_handling\utils.py:rm_rf failed for C:\Users\capnf\anaconda3\pkgs\python-3.9.16-h6244533_0\.cph_tmpxz2l6rsx
{Many more similar lines omitted for brevity.}
BUILD START: ['pybert-4.0.5-np123py_1.tar.bz2']
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
INFO:C:\Users\capnf\anaconda3\lib\site-packages\conda_package_handling\utils.py:rm_rf failed for C:\Users\capnf\anaconda3\pkgs\ca-certificates-2023.01.10-haa95532_0\.cph_tmpc_tze6iu
INFO:C:\Users\capnf\anaconda3\lib\site-packages\conda_package_handling\utils.py:rm_rf failed for C:\Users\capnf\anaconda3\pkgs\ca-certificates-2023.01.10-haa95532_0\.cph_tmptnnun2p2
{Many more similar lines omitted for brevity.}
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(143): Could not remove or rename C:\Users\capnf\anaconda3\pkgs\qt6-main-6.4.2-he04816f_2\.cph_tmp8tthp3vm\pkg-qt6-main-6.4.2-he04816f_2.tar.zst. Please remove this file manually (you may need to reboot to free file handles)
INFO:C:\Users\capnf\anaconda3\lib\site-packages\conda_package_handling\utils.py:rm_rf failed for C:\Users\capnf\anaconda3\pkgs\pooch-1.4.0-pyhd3eb1b0_0\.cph_tmpse2dlzdg
INFO:C:\Users\capnf\anaconda3\lib\site-packages\conda_package_handling\utils.py:rm_rf failed for C:\Users\capnf\anaconda3\pkgs\pooch-1.4.0-pyhd3eb1b0_0\.cph_tmpfv2cch54
{Many more similar lines omitted for brevity.}
## Package Plan ##
environment location: C:\Users\capnf\anaconda3\conda-bld\pybert_1676055211232\_h_env
The following NEW packages will be INSTALLED:
appdirs: 1.4.4-pyhd3eb1b0_0
asttokens: 2.0.5-pyhd3eb1b0_0
backcall: 0.2.0-pyhd3eb1b0_0
blas: 1.0-mkl
{Many more package version specifiers omitted for brevity.}
{Solve appears to have succeeded.}
Traceback (most recent call last):
File "C:\Users\capnf\anaconda3\Scripts\conda-build-script.py", line 10, in <module>
sys.exit(main())
File "C:\Users\capnf\anaconda3\lib\site-packages\conda_build\cli\main_build.py", line 496, in main
execute(sys.argv[1:])
File "C:\Users\capnf\anaconda3\lib\site-packages\conda_build\cli\main_build.py", line 485, in execute
outputs = api.build(args.recipe, post=args.post, test_run_post=args.test_run_post,
File "C:\Users\capnf\anaconda3\lib\site-packages\conda_build\api.py", line 186, in build
return build_tree(
File "C:\Users\capnf\anaconda3\lib\site-packages\conda_build\build.py", line 3091, in build_tree
packages_from_this = build(metadata, stats,
File "C:\Users\capnf\anaconda3\lib\site-packages\conda_build\build.py", line 2131, in build
create_build_envs(top_level_pkg, notest)
File "C:\Users\capnf\anaconda3\lib\site-packages\conda_build\build.py", line 2011, in create_build_envs
environ.create_env(m.config.build_prefix, build_actions, env='build',
File "C:\Users\capnf\anaconda3\lib\site-packages\conda_build\environ.py", line 910, in create_env
execute_actions(actions, index)
File "C:\Users\capnf\anaconda3\lib\site-packages\conda\common\io.py", line 86, in decorated
return f(*args, **kwds)
File "C:\Users\capnf\anaconda3\lib\site-packages\conda\plan.py", line 324, in execute_actions
execute_instructions(plan, index, verbose)
File "C:\Users\capnf\anaconda3\lib\site-packages\conda\plan.py", line 535, in execute_instructions
cmd(state, arg)
File "C:\Users\capnf\anaconda3\lib\site-packages\conda\instructions.py", line 67, in PROGRESSIVEFETCHEXTRACT_CMD
progressive_fetch_extract.execute()
File "C:\Users\capnf\anaconda3\lib\site-packages\conda\core\package_cache_data.py", line 664, in execute
raise CondaMultiError(exceptions)
conda.CondaMultiError: Error with archive C:\Users\capnf\anaconda3\pkgs\qt6-main-6.4.2-he04816f_2\.cph_tmp8tthp3vm\pkg-qt6-main-6.4.2-he04816f_2.tar.zst. You probably need to delete and re-download or re-create this file. Message from libarchive was:
Can't create '\\?\C:\Users\capnf\anaconda3\pkgs\qt6-main-6.4.2-he04816f_2\Library\bin\windeployqt6.exe'
My system specifics:
Dell XPS15 7590 32GB Windows11 Home
(base)
capnf#DESKTOP-G84ND7C MINGW64 ~/Documents/GitHub/PyBERT (master)
$ python --version
Python 3.9.13
(base)
capnf#DESKTOP-G84ND7C MINGW64 ~/Documents/GitHub/PyBERT (master)
$ conda --version
conda 22.9.0
(base)
capnf#DESKTOP-G84ND7C MINGW64 ~/Documents/GitHub/PyBERT (master)
$ conda list anaconda
# packages in environment at C:\Users\capnf\anaconda3:
#
# Name Version Build Channel
anaconda 2022.10 py39_0
anaconda-client 1.11.0 py39haa95532_0
anaconda-navigator 2.3.1 py39haa95532_0
anaconda-project 0.11.1 py39haa95532_0
I can't get Anaconda Prompt to launch, either as Admin. or regular user.
So, I can't try that experiment.
And sudo doesn't work in MINGW on Windows.
So, I can't tell if it's a permissions thing. :(
I faced the same issue on Windows with up-to-date conda and conda-package-handling. Works fine on Linux.
I filled a bug at https://github.com/conda/conda/issues/12369

Installing PyQt5 in pyenv created virtual envirionment

I'm currently struggling to install a python package in a virtual environment. The set-up is the following: I have an M1 mac and with it, I have the system python installations located in /usr/bin/python (v 2.7.18) and usr/bin/python3 (v 3.8.9). Since I don't really like messing with these, I have installed pyenv and pyenv-virtualenv over brew. I installed Python 3.10.1 and created a virtual environment, let's call it test. I also added the following lines to .zshrc
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew'
PATH=$(pyenv root)/shims:$PATH
(Most of this was done by following the explanations on the github page of pyenv).
I'm now trying to install some packages in test. numpy, scipy, etc worked perfectly but when I try to install PyQt5 with pip I get an error.
❯ pip install PyQt5
Collecting PyQt5
Using cached PyQt5-5.15.6.tar.gz (3.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: /Users/UserName/.pyenv/versions/3.10.1/envs/simpy/bin/python3.10 /Users/UserName/.pyenv/versions/3.10.1/envs/simpy/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /var/folders/yk/q1gxptj56gj5n3jt8l48xj580000gn/T/tmp2ofsepfy
cwd: /private/var/folders/yk/q1gxptj56gj5n3jt8l48xj580000gn/T/pip-install-5rev2dd7/pyqt5_3892c9f35c2f41a186bcd36237d536d7
Complete output (29 lines):
Traceback (most recent call last):
File "/Users/UserName/.pyenv/versions/3.10.1/envs/simpy/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/UserName/.pyenv/versions/3.10.1/envs/simpy/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/Users/UserName/.pyenv/versions/3.10.1/envs/simpy/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Users/UserName/.pyenv/versions/3.10.1/envs/simpy/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 160, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "/private/var/folders/yk/q1gxptj56gj5n3jt8l48xj580000gn/T/pip-build-env-vyb7aqa6/overlay/lib/python3.10/site-packages/sipbuild/api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "/private/var/folders/yk/q1gxptj56gj5n3jt8l48xj580000gn/T/pip-build-env-vyb7aqa6/overlay/lib/python3.10/site-packages/sipbuild/abstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "/private/var/folders/yk/q1gxptj56gj5n3jt8l48xj580000gn/T/pip-build-env-vyb7aqa6/overlay/lib/python3.10/site-packages/sipbuild/project.py", line 587, in setup
self.apply_user_defaults(tool)
File "/private/var/folders/yk/q1gxptj56gj5n3jt8l48xj580000gn/T/pip-install-5rev2dd7/pyqt5_3892c9f35c2f41a186bcd36237d536d7/project.py", line 63, in apply_user_defaults
super().apply_user_defaults(tool)
File "/private/var/folders/yk/q1gxptj56gj5n3jt8l48xj580000gn/T/pip-build-env-vyb7aqa6/overlay/lib/python3.10/site-packages/pyqtbuild/project.py", line 70, in apply_user_defaults
super().apply_user_defaults(tool)
File "/private/var/folders/yk/q1gxptj56gj5n3jt8l48xj580000gn/T/pip-build-env-vyb7aqa6/overlay/lib/python3.10/site-packages/sipbuild/project.py", line 234, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "/private/var/folders/yk/q1gxptj56gj5n3jt8l48xj580000gn/T/pip-build-env-vyb7aqa6/overlay/lib/python3.10/site-packages/pyqtbuild/builder.py", line 67, in apply_user_defaults
raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3b/27/fd81188a35f37be9b3b4c2db1654d9439d1418823916fe702ac3658c9c41/PyQt5-5.15.6.tar.gz#sha256=80343bcab95ffba619f2ed2467fd828ffeb0a251ad7225be5fc06dcc333af452 (from https://pypi.org/simple/pyqt5/) (requires-python:>=3.6). Command errored out with exit status 1: /Users/UserName/.pyenv/versions/3.10.1/envs/simpy/bin/python3.10 /Users/UserName/.pyenv/versions/3.10.1/envs/simpy/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /var/folders/yk/q1gxptj56gj5n3jt8l48xj580000gn/T/tmp2ofsepfy Check the logs for full command output.
What exactly is going on here? Is this related to the m1 chip or the set-up of the virtual environment? How can I fix this?
On the suggestion of #pedro_bb7 I downgraded Python to 3.9.9 (since PyQt5 is not yet ready for Python 3.10.0) and also tried installing an older versions (5.14.1/2/, 5.15.0/1/2/3/4/5/6) of PyQt5 over the command
❯ pip install PyQt5==5.14.0
Collecting PyQt5==5.14.0
Using cached PyQt5-5.14.0.tar.gz (3.2 MB)
ERROR: PyQt5==5.14.0 from https://files.pythonhosted.org/packages/7c/5b/e760ec4f868cb77cee45b4554bf15d3fe6972176e89c4e3faac941213694/PyQt5-5.14.0.tar.gz#sha256=0145a6b7de15756366decb736c349a0cb510d706c83fda5b8cd9e0557bc1da72 has a pyproject.toml file that does not comply with PEP 518: 'build-system.requires' contains an invalid requirement: 'sip >=5.0.1 <6'
As you can see, still no luck...
Probably you need to upgrade pip to the latest, as suggested:
pip install --upgrade pip
https://stackoverflow.com/a/67606704/11381650
EDIT: it's not yet supported for Python 3.10 as you can see:
https://github.com/altendky/pyqt-tools/issues/98
and try different versions of PyQt, could you try 5.14.0 for Python 3.9?
https://stackoverflow.com/a/59797479/11381650
Method 1: Use rosetta terminal, install pyqt5
Youtube link to open rosetta terminal on Mac m1
https://www.youtube.com/watch?v=9W8rTTE1WEA
And then use pip to install under your virtual enviorment
pip install PyQt5
Method 2: Running under pyqt6
Like LemurPwned said in How can I run pyqt5 on my Mac with M1chip (ppc64el architecture)?
pyqt6 is now easily installable via pip on M1/M2 Macs
You can install that via
pip install PyQt6

Installing scikits.samplerate fails

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

PyCluster unable to install package

This is the error I am getting when trying to install PyCluster. I am using python 2.7 with anaconda in spyder IDE and on windows.
Downloading/unpacking PyCluster
Getting page http://pypi.python.org/simple/PyCluster
URLs to search for versions for PyCluster:
* httpss://pypi.python.org/simple/PyCluster/
Getting page httpss://pypi.python.org/simple/PyCluster/
Analyzing links from page httpss://pypi.python.org/simple/pycluster/
Could not find any downloads that satisfy the requirement PyCluster
No distributions at all found for PyCluster
Exception information:
Traceback (most recent call last):
File "C:\Users\anankuma\AppData\Local\Continuum\Anaconda\lib\site-packages\pip-1.2.1-py2.7.egg\pip\basecommand.py", line 107, in main
status = self.run(options, args)
File "C:\Users\anankuma\AppData\Local\Continuum\Anaconda\lib\site-packages\pip-1.2.1-py2.7.egg\pip\commands\install.py", line 256, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Users\anankuma\AppData\Local\Continuum\Anaconda\lib\site-packages\pip-1.2.1-py2.7.egg\pip\req.py", line 1011, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "C:\Users\anankuma\AppData\Local\Continuum\Anaconda\lib\site-packages\pip-1.2.1-py2.7.egg\pip\index.py", line 157, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for PyCluster
Please suggest a workaround. Thanks
here is the package there is no source or binary available to download.
a module (pyclustering) with similar name.
The Python Package Index (PYPI) is a repository of software for the Python programming language.
One can download packages manually or using pip install
One can upload binary and source packages as well.
For example this package has a source and some binaries as well
Python Wheels and Python Eggs are ease to install, mostly used on windows.
However manual install can be done using MS Windows installer files downloaded directly form PYPI
Had a similar situation installing this Pycluster package
pip was trying to build the package because there were no official wheels
for Python 3.5 & windows.
Solved it by downloading an unofficial wheel from here:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycluster
There are many wheel files on this website.
Try different versions to see whichever works the best for you.
You can install the .whl file this way using Anaconda Prompt with the following code
pip install Pycluster-1.56-cp36-cp36m-win_amd64.whl
install with pip:
pip3 install pyclustering
it even works with Anaconda prompt

Installing apptrace in OS X for debugging GAE app memory, error: pkg_resources.DistributionNotFound: apptrace==0.2.3

I am trying to install and use apptrace on OS X in order to debug GAE memory...
It's been complicated and I still haven't managed to get it installed.
The docs say this is the easiest way to install:
easy_install apptrace
But in order for that to work I had to install a bunch of dependencies like ActiveState, Guppy and probably some more...
Lots of trials and errors later, I think I got fairly far, but still not there. So I do this in order to try to reinstall apptrace and then install it to catch all errors in the process:
$ sudo pip uninstall apptrace
Uninstalling apptrace:
/Library/Frameworks/Python.framework/Versions/2.7/bin/apptracectl
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/apptrace-0.2.3-py2.7.egg
Proceed (y/n)? y
Successfully uninstalled apptrace
Then install
$ sudo easy_install apptrace
Searching for apptrace
Reading https://pypi.python.org/simple/apptrace/
Reading http://code.google.com/p/apptrace
Best match: apptrace 0.2.3
Downloading https://pypi.python.org/packages/source/a/apptrace/apptrace-0.2.3.tar.gz#md5=ed03efe7afd70584a4bd461f429bdb75
Processing apptrace-0.2.3.tar.gz
Writing /tmp/easy_install-xi0K_4/apptrace-0.2.3/setup.cfg
Running apptrace-0.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-xi0K_4/apptrace-0.2.3/egg-dist-tmp-zhij3l
Adding apptrace 0.2.3 to easy-install.pth file
Installing apptracectl script to /Library/Frameworks/Python.framework/Versions/2.7/bin
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/apptrace-0.2.3-py2.7.egg
Processing dependencies for apptrace
Finished processing dependencies for apptrace
It doesn't look like any errors occurred right?
Then the docs suggest to create a appengine_config.py file in the app root containing this:
def webapp_add_wsgi_middleware(app):
from apptrace.middleware import apptrace_middleware
return apptrace_middleware(app)
Having done that the next required step is:
apptracectl init <application root directory>
And this happens:
Traceback (most recent call last):
File "/usr/local/bin/apptracectl", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: apptrace==0.2.3
So the error here is pkg_resources.DistributionNotFound: apptrace==0.2.3
What do I do?

Categories