Getting ImportError: No module named speech_recognition,
Code Snippet:
# for speech-to-text
import speech_recognition as sr
# for text-to-speech
from gtts import gTTS
# for language model
import transformers
import os
import time
# for data
import os
import datetime
import numpy as np
I have already tried pip3 install SpeechRecognition and pip install SpeechRecognition
pip3 install SpeechRecognition
Requirement already satisfied: SpeechRecognition in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (3.8.1)
WARNING: You are using pip version 21.3.1; however, version 22.1.2 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
I am using Python 3.8
Related
i have installed six but i got error below:
from six.moves import urllib
ImportError: No module named six.moves
When executing
pip install six.moves
:
Could not find a version that satisfies the requirement six.moves (from versions: )
No matching distribution found for six.moves
i am using python 3.5.6
Tensorflow 1.x is deprecated to use and no longer supported. This could be the reason for the above error.
Please try again by upgrading the tensorflow version to TF 2.x as per this tested build configuration which does not show any error while importing the above package.
You can use below code to install tensorflow
!pip install --upgrade tensorflow #or
!pip install tensorflow==2.2 # can mention specific TF version to install
and then import six package libraries
from six.moves import urllib
Note: This six package get installed automatically while installing tensorflow:
Does anyone know the solution of this problem:
ImportError: cannot import name 'constrained_dtw' from 'dtw'
I installed python DTW (Dynamic Time Warping) module via
pip install dtw
and I tried to solve it by install:
pip install dtaidistance
pip install dtw-python
without any result
I'm trying to import montage2d module from scikit-image:
from skimage.util.montage import montage2d
But this error popped up:
ModuleNotFoundError: No module named 'skimage.util.montage'
I'm pretty sure I installed the scikit-image package as:
pip install scikit-image (0.18.1)
I'm trying pip install scikit-image==0.13.1 but it failed
enter image description here
Try:
from skimage.util import montage
Or, with older versions:
pip install scikit-image==0.13.1
from skimage.util.montage import montage2d
I am trying to run basic dataframe profile on my dataset. I am using databricks python notebook.
pip install --upgrade pip
pip install --upgrade setuptools
pip install pandas-profiling
import numpy as np
import pandas as pd
from pandas_profiling import ProfileReport
df = sql("select * from table").cache()
prof = ProfileReport(df)
prof.to_file(output_file='output.html')
output
Successfully installed pip-20.1.1
Successfully installed setuptools-47.1.1
Successfully installed MarkupSafe-1.1.1 Pillow-7.1.2 PyWavelets-1.1.1 Send2Trash-1.5.0 astropy-4.0.1.post1 attrs-19.3.0 bleach-3.1.5 confuse-1.1.0 defusedxml-0.6.0 entrypoints-0.3 htmlmin-0.1.12 imagehash-4.1.0 importlib-metadata-1.6.1 ipywidgets-7.5.1 jinja2-2.11.2 joblib-0.15.1 jsonschema-3.2.0 llvmlite-0.32.1 matplotlib-3.2.1 missingno-0.4.2 mistune-0.8.4 nbconvert-5.6.1 nbformat-5.0.6 networkx-2.4 notebook-6.0.3 numba-0.49.1 packaging-20.4 pandas-1.0.4 pandas-profiling-2.8.0 pandocfilters-1.4.2 phik-0.10.0 prometheus-client-0.8.0 pyrsistent-0.16.0 pyyaml-5.3.1 requests-2.23.0 scipy-1.4.1 tangled-up-in-unicode-0.0.6 terminado-0.8.3 testpath-0.4.4 tqdm-4.46.1 visions-0.4.4 webencodings-0.5.1 widgetsnbextension-3.5.1 zipp-3.1.0
I am getting the following error :-
ImportError: cannot import name 'PY2' from 'scipy._lib.six' (/databricks/python/lib/python3.7/site-packages/scipy/_lib/six.py)
How can I resolve this error ?
Issue is with scipy package.
This worked for me.
%sh
/databricks/python/bin/pip install --upgrade pip
/databricks/python/bin/pip install scipy
/databricks/python/bin/pip install pandas_profiling
dbutils.library.restartPython()
import pandas_profiling
OR
!pip install --upgrade pip
!pip install --upgrade setuptools
!pip install scipy
!pip install pandas-profiling
dbutils.library.restartPython()
import pandas_profiling
my python version is 2.7.14 in windows 7
I have import simplejson with command "pip install simplejson"
my code is
import os
import platform
import re
import subprocess
import sys
import threading
import simplejson
error messge is
ImportError: No module named simplejson
how can i fix this ?
Download it from here - simplejson 3.12.0
Install
Enjoy
If you have Python and pip in your PATH just run the following command in your console.
$ pip install simplejson
The console will return the following output
Collecting simplejson
Downloading simplejson-3.13.2-cp27-cp27m-win32.whl (68kB)
Installing collected packages: simplejson
Successfully installed simplejson-3.13.2