Librosa on jython - jython

I installed Jython 2.7.1 and want to get librosa to work to get theier mfcc transformations to work. I have issues installing it as it seems to rely on numpy which uses C but Jpython does not do C. I found JyNi as some layer in-between to get this to work. Is there any installation guidance that i could get? (for mac osx)
Regards

Related

How to debug Kmeans clusters on python 3.9 tensorflow on Mac M1 pro?

When you installed python 3.9 tensorflow on new Mac M1 chip, you would probably come to this bug when you run Kmeans.predict():
nonetype' object has no attribute 'split'
I have searched online for a long time but cannot find any useful solution. So if you happen to have the same issue as mine, maybe you can try this:
Find the file threadpoolctl.py under /Users/YOURNAME/miniforge3/envs/tensorflow/lib/python3.9/site-packages
Replace it by the file in this website:
https://github.com/joblib/threadpoolctl/blob/master/threadpoolctl.py
Restart your python
Hope it helps.
+100500 to the karma: worked for me as well within Python 3.8. The version of threadpoolctl.py was "2.1.0" - after making an update by version "3.2.0.dev0" KMeans started to work.

What is the numpy pypi package naming convention

Trying to determine which numpy package is compatible with my python environment. My server has no internet access, so I need to download and install the package locally.
I know the cp27 refers to Python 2.7, but what is the difference between these two packages:
numpy-1.12.0rc1-cp27-cp27m-manylinux1_x86_64.whl
numpy-1.12.0rc1-cp27-cp27mu-manylinux1_x86_64.whl
The differing part is an ABI tag.
mu indicates --enable-unicode=ucs4
m on its own is --enable-unicode=ucs2
See UCS-2 vs UCS-4 builds; to determine which you need for your current installation, see How to find out if Python is compiled with UCS-2 or UCS-4?

Python Packaging Fix: Understand Differences between Wheel and Egg; How to get local fix to wider audience?

I'm trying to understand why the easy_install of pyicu works and pip install doesn't (see below). also trying to understand "What is the difference between a PyPi project with a universal wheel and one without?" Will installs be "easier?". If so, will this merge request solve the problem of polyglot not installing on an Anaconda machine?
Need help/advice/solutions on how to best resolve python project install issue that is tied to underlying dependencies. I have two local fixes in GitHub Gists but would like to know the best way to have this fix "out there" so people like me can find it. What is the normal Python Community approach? The problem centers around three projects:
polyglot - a python multilingual NLP toolkit
pyicu - Python extension wrapping IBM's International Components for Unicode C++ library (ICU).
pycld2 - CLD (Compact Language Detection) library as maintained by Dick Sites
The goal:
Install polyglot on a MacOSX computer running Python Anaconda Distribution
Make the fix I found available to everyone; lots of issues published about the problem.
Here's the error trace:
The Problem (Lots of them):
Core polyglot dependency, pyicu, does not properly install when you use pip install. Discovered you must use easy_install for it build properly and work on MacOSX. If you don't use the easy_install, you get:
polyglot requires icu 54.1.1 to run in Anaconda, but...
Homebrew, the MacOSX tool to install icu, only installs version 58.1. That version is too new. Old stackoverflows advise brew install icu4c to fix problem, but Homebrew evolution makes that advice obsolete now.
pyicu does not have a universal wheel; but I created a merge request to add one to pyicu. Only way to fix this is with this channel's icu, https://anaconda.org/ccordoba12/icu. conda install icu will not work, but that's the normal conda way of doing things.
*pycld2 - CLD (Compact Language Detection) becomes a problem because after I build the wheel file locally, have to download the project and run setup.py install locally. There has to be a better way to do this right?
What I've Done to Solve the problem (should I do more, what should I do next?)
Created two Gists that can successfully install polyglot on a Mac running Anaconda for Python 2.7 or Python 3.5
Python 2.7 fix
Python 3.5 fix
created the merge request for pyicu
Both Gist fixes work. But, is this error in install tied to the wheel? If I installed pyicu with easy_install, the install works. But, with pip, it doesn't?
What are the steps to take in the Python community to fix it so people can find the solution or just pip install with no problems?
I did a test, and if the wheel file is built, the pip works with no issues.

pyinstaller with matplotlib windows

I use pyinstaller in generate pythion program with matplotlib a exe file
The exe is generated well but when use the exe, there is a error said no module named 'tz'
what does it mean?
I have test the pythinstaller with program with numby and pyqt4 without matplotlib, it worksenter image description here well! )
I have find the solution on pyinstaller git hub provided by Cecil Curry.
It is:
This is a known issue. python-dateutil 2.5.0 is currently broken with respect to PyInstaller, unfortunately.
Until python-dateutil issues a new stable release correcting this, consider temporarily downgrading to python-dateutil 2.4.2. Apologies for the mild inconvenience – and thanks for taking the time to report this, nonetheless.
I have tested and it works

PyPlot in Julia giving "no module named site" error

I have started playing with Julia today. I was following Steven's MIT turorials to get started. However, when I reached the Plotting section I tried importing PyPlot with:
using PyPlot
however it gave me the following error:
ImportError: No module named site
WARNING: backtraces on your platform are often misleading or partially incorrect
could not load module python: The specified module could not be found.
at C:\Users\Dipto\.julia\PyPlot\src\PyPlot.jl:32
at In[1]:1
in pyinitialize at C:\Users\Dipto\.julia\PyCall\src\PyCall.jl:406
I use Canopy as my Python installation, so all modules required by pyplot should already be available on the machine.
N.B. As indicated in the tutorial I did use Pkg.add("PyPlot") in Julia to install pyplot in Julia as well.
It looks like problem is that PyCall (the bridge between Julia and Python) does not work with Canopy. See: https://github.com/stevengj/PyCall.jl/issues/42.
I ran into the same problem recently after doing a package update, Pkg.update(). It gave me some errors with Nettle and whatnot during the update.
The solution was to delete the .julia directory and reinstall all the needed packages.
The only caveat I feel I have to give is that previous to this recent "reinstall" I used http instead of git for downloading Julia packages. I don't expect this to be an issue though.
Setup
Windows 7 Pro 64-bit
Julia 0.2.0 (2013-11-16 23:44 UTC)
Python 3.3.2 (v3.3.2:d047928ae3f6)
PyPlot 1.1.0
Anaconda (unknown version, installed October 28, 2013)