Error while importing scikits.talkbox - python-3.x

I want to use scikits.talkbox, but i get the following error while import scikits.talkbox.
Traceback (most recent call last):
File "/home/seref/Desktop/machine learning codes/MFCC/main.py", line 3, in
from scikits.talkbox.features.mfcc import mfcc
File "/usr/local/lib/python3.5/dist-packages/scikits/talkbox/init.py", line 3, in
from tools import *
ImportError: No module named 'tools'
code sample
import scipy.io.wavfile
from scikits.talkbox.features.mfcc import mfcc
sample_rate, X = scipy.io.wavfile.read("data/test_1.wav")
ceps, mspec, spec = mfcc(X)
I use following code when installing scikits.talkbox
sudo pip3 install scikits.talkbox
Operation system ubuntu 16.10
python interpreter 3.5.2+

If you want MFCCs in Python 3, librosa is probably the better library of your choice.

Related

ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

I have a simple python program which I am running on a Mac machine.
import numpy as np
def main():
print("np arr test")
arr = np.array([1.0, 2.0, 3.0])
print(arr)
if __name__ == "__main__":
main()
I've verified that the numpy library was correct installed through pip
pip3 list | grep numpy
msgpack-numpy 0.4.4.3
numpy 1.16.2
numpydoc 0.8.0
I get the following error when I run the program
Traceback (most recent call last):
File "/Volumes/brazil-pkg-cache/packages/Python-numpy/Python-numpy-1.x.140450.0/AL2012/DEV.STD.PTHREAD/build/lib/python3.6/site-packages/numpy/core/__init__.py", line 24, in <module>
from . import multiarray
File "/Volumes/brazil-pkg-cache/packages/Python-numpy/Python-numpy-1.x.140450.0/AL2012/DEV.STD.PTHREAD/build/lib/python3.6/site-packages/numpy/core/multiarray.py", line 14, in <module>
from . import overrides
File "/Volumes/brazil-pkg-cache/packages/Python-numpy/Python-numpy-1.x.140450.0/AL2012/DEV.STD.PTHREAD/build/lib/python3.6/site-packages/numpy/core/overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Volumes/workplace/RPAsosDevelopmentWS/src/RPAsosDevelopmentPy/src/rp_asos_development_py/adhoc_dev/float_nan_test.py", line 1, in <module>
import numpy as np
File "/Volumes/brazil-pkg-cache/packages/Python-numpy/Python-numpy-1.x.140450.0/AL2012/DEV.STD.PTHREAD/build/lib/python3.6/site-packages/numpy/__init__.py", line 142, in <module>
from . import core
File "/Volumes/brazil-pkg-cache/packages/Python-numpy/Python-numpy-1.x.140450.0/AL2012/DEV.STD.PTHREAD/build/lib/python3.6/site-packages/numpy/core/__init__.py", line 50, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.6 from "/usr/local/bin/python3.6"
* The NumPy version is: "1.18.4"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'
Process finished with exit code 1
Can you please help me figure out what I am missing? Appreciate your response!
NOTE : Based on the stack overflow post I updated the numpy through the following command
pip3 install numpy --upgrade
pip3 list | grep numpy
msgpack-numpy 0.4.4.3
numpy 1.21.2
numpydoc 0.8.0
WARNING: You are using pip version 21.2.1; however, version 21.2.4 is available.
However I still see the error message
Try to uninstall numpy and install it again.

Cannot import installed python package (MacOS)

I cannot import any python package when running python on Visual Studio code or on my Terminal. I can still do this if I were to code on a Jupyter notebook. However, when I tried other environment that doesn't use the notebook server. It returns me ModuleNotFound Error like this
Traceback (most recent call last):
File "/Users/truongminh/Desktop/DataScience/Datasets/CityU Text/test_PreprocessText.py", line 1, in <module>
import PreprocessText
File "/Users/truongminh/Desktop/DataScience/Datasets/CityU Text/PreprocessText.py", line 1, in <module>
import pandas as pd
ModuleNotFoundError: No module named 'pandas'
Most of my packages was download via anaconda. I don't know if it might be the cause of this.

Why does command prompt import differ from sublime text import?

I have installed with pip several packages (numpy/pandas/blpapi/pyarrow). I work with a Windows 64-bit machine, python3.6 in a sublime environment.
While all packages are shown as correctly imported in the command prompt, some packages are not found by my sublime scripts.
To try and remedy this problem, I used sys.path.insert and changed the names of my scripts, to no avail. The traceback below describes what I'm seeing:
Code in Command Prompt:
>>> import pyarrow
>>> import pandas
>>>
Code in Sublime (better_name.py):
print('Hi')
import numpy
import pandas
Output of better_name.py:
Hi
Traceback (most recent call last):
File "C:\Users\Documents\better_name.py", line 4, in <module>
import pandas
ModuleNotFoundError: No module named 'pandas'
Obtaining the paths in Command Prompt:
>>> import os
>>> import numpy
>>> path = os.path.dirname(numpy.__file__)
>>> print(path)
C:\Users\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy
>>> import pandas
>>> path = os.path.dirname(pandas.__file__)
>>> print(path)
C:\Users\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas
Trying to use sys.path.insert :
print('Hi')
import sys
import numpy
import os
sys.path.insert(1, r"C:\Users\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas")
Output:
C:\Users\Documents>better_name.py
Hi
Traceback (most recent call last):
File "C:\Users\Documents\better_name.py", line 7, in <module>
import pandas
ModuleNotFoundError: No module named 'pandas'
I get the same results whether I change the argument in sys.path.insert to 0.
The issue seems to be that your default version of python points to the 32-bit version - i.e. when you say python your windows system executes the 32 bit version.
One workaround is to specify the full path of your 64 bit version - i.e. launch your script as
C:\PATH\TO\64-BIT-VERSION\PYTHON.EXE your_script.py
from the command line.
The other option is to set your windows environment variables to point to the 64 bit version by default. This link should help

import rpy2.ipython meet error ModuleNotFoundError: No module named 'IPython'

My python version is 3.6. my OS is windows. After install rpy2 module, when I type import rpy2, got no issue. But when type import rpy2.ipython, got error as below:
>>> import rpy2.ipython
Warning (from warnings module):
File "D:\Soft_app\Python\lib\site-packages\rpy2\ipython\rmagic.py", line 76
"either.")))
UserWarning: The Python package 'pandas' is strongly recommended when using `rpy2.ipython`. Unfortunately it could not be loaded, and we did not manage to load 'numpy' either.
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
import rpy2.ipython
File "D:\Soft_app\Python\lib\site-packages\rpy2\ipython\__init__.py", line 1, in <module>
from .rmagic import load_ipython_extension
File "D:\Soft_app\Python\lib\site-packages\rpy2\ipython\rmagic.py", line 81, in <module>
from IPython.core.displaypub import publish_display_data
ModuleNotFoundError: No module named 'IPython'
Can help to figure out what's issue??
It seems that you are missing Ipython and pandas. Installing them should resolve your issue.
Run "pip install ipython" to install Ipython and run "pip install pandas" to install pandas.
Hopefully, this will solve your problem.
Happy Coding ~

from pandas import * -- Python issue

I am trying to run the following code in python 3.3
from pandas import *
and I receive the following error:
Traceback (most recent call last):
File "C:\Users\Tom\Desktop\ProgrammingStuff\Python\FXCointegrationBacktesting.py", line 9, in <module>
cannot import name text_type
from pandas import *
File "C:\Python33\lib\site-packages\pandas\__init__.py", line 6, in <module>
from . import hashtable, tslib, lib
File "tslib.pyx", line 31, in init pandas.tslib (pandas\tslib.c:48782)
File "C:\Python33\lib\site-packages\dateutil\parser.py", line 24, in <module>
from six import text_type, binary_type, integer_types
ImportError: cannot import name text_type
Not sure what the problem is, I am fairly new to python and I cannot currently find any solutions to this problem on stack overflow.
Thanks!
You're using a version of dateutil that depends on six.
In dateutil <= 1.5 you don't need six, but those versions are not compatible with Python >= 3.0. So, the solution is to install six. However you do that is up to you.
You could do
pip install six
If you choose not to use pip it will depend on your system's package manager how you go about installing it.

Resources