TinyTag import error python 3.3 - python-3.x

I have been trying to import tinytag into python to be able to read mp3 tags but I keep receiving the same error. This is the code I am running
from tinytag import TinyTag
tag = TinyTag.get('/some/music.mp3)
print(tag.album)
and the error I recieve from this is
ImportError: No module named 'tinytag'
If anyone could give me any information on how to fix this would be greatly appreciated or can suggest another reader to use that is compatible with python 3.

Like you, I'm new to Python and I struggled with this but I worked it out eventually. I'm sure there is better way, but this worked (on windows, with my examples)
I installed a python module called easy_install (bundled with
setuptools). you can Google this. In the directory \Python26\Scripts you should see an exe file called easy_install if this has worked
Then I downloaded TinyTag to my pc eg
\downloads\tinytag-0.6.1.tar.gz
Then in note pad I wrote a small text file called myinstall.bat with
the contents
easy_install C:/downloads/tinytag-0.6.1.tar.gz
pause
then saved it into \Python26\Scripts and ran it (the pause keeps the
window open so you can see it worked)
Subsequently I started using some software called JetBrains to code with (it's commercial but there is a free edition) and that has an install tool built in which is even easier) I hope this helps

Related

What are Python3 libraries which replace "from scikits.audiolab import Format, Sndfile"

Hope you'll are doing good. I am new to python. I am trying to use audio.scikits library in python3 verion. I have a working code version in 2.7(with audio.scikits) . While I am running with python3 version I am getting the Import Error: No Module Named 'Version' error. I get to know that python3 is not anymore supporting audio.scikits(If I am not wrong). Can anyone suggest me replacing library for audio.scikits where I can use all the functionalities like audio.scikits do OR any other solution which might helps me. Thanks in advance.
2.7 Version Code :
from scikits.audiolab import Format, Sndfile
from scipy.signal import firwin, lfilter
array = np.array(all)
fmt = Format('flac', 'pcm16')
nchannels = 1
cd, FileNameTmp = mkstemp('TmpSpeechFile.wav')
# making the file .flac
afile = Sndfile(FileNameTmp, 'w', fmt, nchannels, RawRate)
#writing in the file
afile.write_frames(array)
SendSpeech(FileNameTmp)
To check entire code please visit :Google Asterisk Reference Code(modifying based on this code)
I want to modify this code with python3 supported libraries. Here I am doing this for Asterisk-Microsoft-Speech To Text SDK.
Firstly the link code you paste is Asterisk-Google-Speech-Recognition, it's not the Microsoft-Speech-To-Text, if you want get a sample about Microsoft-Speech-To-Text you could refer to the official doc:Recognize speech from an audio file.
And about your problem you said, yes it's not completely compatible, in the github issue there is a solution for it, you could refer to this comment.

IAC-protocol interface error on python 3

I would like to work with excell sheets (.xls likely per .ods conversion) via python while maintaining all of the sheet's original content. Unlike xlutils (http://www.python-excel.org/) the iac-protocol (http://pythonhosted.org/iac-protocol/index.html) seems to me to be more fit/elegant tool to maintain sheet's style,formulas,dropboxes etc. One of the steps to launch iac's server or interpreter (iacs/iaci) is to initialize the interface which consists among others of this command:
import iac.app.libreoffice.calc as localc
While import iac.app.libreoffice works fine
moving to calc level
import iac.app.libreoffice.calc
throws following error
import iac.app.libreoffice.calc
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.4/site-packages/iac/app/libreoffice/calc.py", line 11, in
from uno import getComponentContext
ImportError: cannot import name 'getComponentContext'
From what I've learned so far on this forum it might be linked to method name duplicity between two modules. This is where I am stuck. How do I learn which other module has such name of a method and how to fix it? Both iac-protocol and unotools are modules downloaded via pip3. I did not created method of such name in any script.
Thank you in advance for any advice!
Python3.4 on Scientific Linux release 7.3 (Nitrogen) LibreOffice 5.0.6.2 00(Build:2)
Some questions to narrow down the problem:
Did you start libreoffice listening on a socket first?
Did you import anything else before import iac.app.libreoffice.calc?
What happens when you start python in a terminal and enter from uno import getComponentContext?
I installed iac-protocol on Linux Mint and was able to import iac.app.libreoffice.calc and then use it. The installation process was complex, so I wouldn't be surprised if there is some problem with how your packages were installed, or possibly it does not work on RHEL-based systems. For one thing, it required me to install gnumeric.
The Calc "Hello World" code that worked for me is as follows.
libreoffice "--accept=socket,host=localhost,port=18100;urp;StarOffice.ServiceManager" --norestore --nofirststartwizard --nologo --calc &
python3
>>> import iac.app.libreoffice.calc as localc
>>> doc = localc.Interface.current_document()
>>> sheet = doc.getSheets().getByIndex(0)
>>> cell = sheet.getCellByPosition(0,0)
>>> cell.setString("Hello, World!")
One more thought: Have you considered using straight PyUNO starting from import uno instead of a wrapper library? That would avoid dependency on some of the extra libraries which may be causing the problem. Also there is better documentation for straight PyUNO.

mkl_blas_dgemm_alloc not found in mkl_intel_thread

I developed a a tool in python 3.5 some time ago which currently only uses differential evolution from scipy to do its task. For some reasons I had to change settings on my machine and switch to use python in a virtual environment.
My specs now:
win 10 64 bit
used pip 9.0.1
numpy 1.12.1+mkl
scipy 0.19.0
python 3.6.1
I have a different env using python 2.7 flying around somewhere else.
Now my problem....everytime the differential evolution function gets its first set of data it crashes after returning the differential_evolution step value.
The differential_evolution call can be found under ./libraries/methods/differential_evoluation.py line 76
The pop-up Error is "Entry point 'mkl_blas_dgemm_alloc wasn't found in 'mkl_intel_thread.dll'." And the printed error is "Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll." Please notice that my system language is german therfore the pop-up message was translated by me.
I don't know whether this is relevant but my directory structure is:
>some_place/location1/goal.py
>some_place/location2/env/
I didn't work with virtualenv before and in addition to this i used python 3.5. I'd appreciate any help or instructions on how to add more information to this case to help clarify my problem.
Yours sincerely
OK I'm back with more information. Maybe someone else will stumble uppon it. To be clear: I do not know the fix or reason. I just tried a bunch of stuff.
Using
python 3.5.3,numpy 1.11.1+mkl and scipy-0.18.0 or scipy-0.19.0
made the error disappear. I couldn't try numpy 1.11.1 or 1.11.2 for python 3.6 because this kind soul sadly doesn't offer those versions anymore. I found the 1.11.1 version for python 3.5 somewhere on my disk.
From my testing i can tell that it breaks once i use numpy 1.11.3 or higher. 1.11.1 works fine. Therefore I assume that some changes happened either in numpy between 1.11.1 and 1.11.3 which break it OR in how this kind soul creates/builds his wheels. So I'm going to use python 3.5 for now as i do not have numpy 1.11.1+mkl for python 3.6.
Yours sincerely

Python Leap motion Libraries not working

I am trying to use my Leap motion in Python 3.4, but I cant even get import Leap to work. The python file I am trying to run is on my desktop, along with all the library files (Leap.py, LeapPython.pyd, Leap.dll, and Leap.lib). Whenever I try to run import Leap in my code, the program just throws this:
ImportError: DLL load failed: The specified module could not be found.
I'm not sure what DLL its talking about, I already tried putting msvcp120.dll and msvcr120.dll in the same directory.
I am using Leap Motion SDK Version V2.3.1.31549 on a 64 bit Windows 10 with the 32 bit version of Python 3.4
All help is appreciated.
Thank You!
The Leap Motion SDK only supports Python 2.7.
Some people have reported success using SWIG to regenerate the Python wrapper for Python 3 (the SWIG .i file is included in the SDK). You could also use the LeapC library to to create a Ctypes-based wrapper, which could support multiple versions of Python.

Python 3 relative path conversion issue

I am currently working with converting Pycrypto over to Python 3.X
Whilst I seem to have the cryptography side working the same cannot be said for the tests
provided with the module :(
I have used the tests under Python 2.64 and all works fine.
I then ran '2to3' over the tests to generate new files in 3.X format.
There are several references to the following:
from .common import make_block_tests
Whenever I run the tests I get:
ValueError: Attempted relative import in non-package
If someone would point me towards a way to fix this it would be much appreciated :)
Cheers
Grail
You are trying to run the test files directly, then you can't have relative imports. Change them to be absolute imports, and it will solve the problem.

Resources