I am using MacOS (Apple Silicon) and I am trying to use the whisper module from OpenAI in Python. My code is this:
import whisper
file_path = "4547.mp3"
model = whisper.load_model("base")
result = model.transcribe(file_path)
print(result["text"])
When running that code I get the error:
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg': 'ffmpeg'
I think it is because Python is looking in the wrong folder for ffmpeg and therefore can't find it, but I don't know how to fix that if that is the issue.
I have installed homebrew and used the command 'brew install ffmpeg' and it has successfully installed with no errors. I have tried uninstalling ffmpeg and reinstalling it. I have tried uninstalling open_whisper but to no avail.
Whisper also requires ffmpeg-python be installed per
https://github.com/openai/whisper/blob/main/whisper/audio.py#L40
So, you may need to !pip install ffmpeg-python somewhere and add import ffmpeg-python
Related
When trying to install Python's sklearn package on Windows 10 using pip I am given an EnvironmentError that tells me there is no such file or directory of a specific file:
ERROR: Could not install packages due to an EnvironmentError: [Errno
2] No such file or directory:
'C:\Users\Rik\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sklearn\datasets\tests\data\openml\292\api-v1-json-data-list-data_name-australian-limit-2-data_version-1-status-deactivated.json.gz'
I have tried reinstalling the following packages numerous times:
scikit-learn
scipy
sklearn
I have also tried downloading the github master folder for sklearn and pasting it into the directory where the installer expects the file to be, and even then when installing with pip it tells me the file is missing.
Furthermore I tried installing it via the github repository by downloading it and running
python setup.py install
But this results in weird Microsoft Visual Studio errors because apparently it is trying to run a test program or something, not sure.
Any suggestions to fix this problem?
You can find the solution here: https://scikit-learn.org/stable/install.html
The problem occurs because the default path size limit is reached in your case, you can change this with the following steps:
open regedit tool (using windows cmd)
access the 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem' key
change the 'LongPathsEnabled' value to 1
reinstall sklearn using the command 'pip install --exists-action=i scikit-learn'
I am using this piece of code to display decision tree (from O'Reilly book on ML with python). But got an error message that "no module graphviz".
with open("tree.dot") as f:
dot_graph = f.read()
display(graphviz.Source(dot_graph))
After spending some time searching for similar questions on this site, this is the workflow of my attempt to fix the problem:
installed anaconda3
installed graphviz
conda install graphviz
installed python-graphviz
conda install python-graphviz
installed pydot as suggested in one of the existing answers
conda install pydot
Still no improvement.
I manually added the path to graphviz (I am not sure that /anaconda3//lib/python3.7/site-packages is the right path to graphviz)
import sys
sys.path.append('/anaconda3//lib/python3.7/site-packages')
which led to a new error:
File "/Users/fadoua/ML/ch1.py", line 318, in <module>
display(graphviz.Source(dot_graph))
NameError: name 'display' is not defined
So, I changed the display function call to
graphviz.Source(dot_graph).view()
I got series of messages, maybe the most frightening is:
FileNotFoundError: [Errno 2] No such file or directory: 'dot': 'dot'
I am using python on Xcode platform. Do you have any idea how to fix this issue? Thank you.
I'm running python code which uses the dlib module. I'm using arch linux, so I downloaded dlib from here: https://aur.archlinux.org/packages/dlib/
Then I try to import the dlib module, but it still doesn't work:
ModuleNotFoundError: No module named 'dlib'
Is there a dependency that I didn't download or am I downloading the wrong module? I can't figure out what the problem is, since I downloaded the official module already.
I fixed the problem, all you have to do is to search in your package manager if you are a linux user, and try importing dlib in your python code, if that didn't work, then download dlib from this link: https://sourceforge.net/projects/dclib/files/latest/download
extract the files, and run the setup.py files, it will take a while till it finishes, and that should make it work, you can now run codes using dlib library with no problems.
hope that helps someone :D.
I had a same issue, but you need to download it to your site-packpages of where your python is there for python-idle or if ur getting a download error in pycharm , I solved the error by downloading dlib from cmd to the venv of my pycharm.project directory command being install dlib--19.16.0 (current one) or you can download a .whl file which suits your python,processor configuration run dt .whl file and your good to go
During the installation phase, I get this, "Unable to find vcvarsall.bat" error. The installation process did complete, though. However, I was unable to see the shell on my desktop (I am using windows) and neither was I able to open it manually. I scoured the internet for the error but was unable to find any solution for this case.
The installation process is through a superpack that downloads Python 2.7
SimpleCV is not receiving much love in the past few years, and most of it's code don't got upgrade like the libraries it depends on.
The problem you got is the Superpack trying to compile an older version of OpenCV.
When running the Superpack, you should have seen and redtext error, and if you try to run a code it should show you something like this:
File "C:\Python27\lib\site-packages\SimpleCV\base.py", line 59, in <module>
raise ImportError("Cannot load OpenCV library which is required by SimpleCV")
ImportError: Cannot load OpenCV library which is required by SimpleCV
There are a few paths you can try from there:
1. You can try to install Microsoft Visual C++ Compiler for Python 2.7
Uninstall everything SuperPack installed in your PC or it may not work
It may fixes some other uses when using pip.
Now you have to install SimpleCV again.
2. Try to install OpenCV(2.3) on your own:
You can use pip for it, just remember to chose 32bits to keep compatibility with (Super Pack)
Just run on CMD
pip install OpenCV or python -m pip install OpenCV
3. Give up on SuperPack and install everything on your own.
You can try this guide
https://github.com/sightmachine/SimpleCV#windows-7vista
Or use pip for all dependencies
numpy (Numpy+MKL make sure to install this one first)
scipy
PIL
ipython
svgwrite
pygame==1.9.1release
OpenCV
You can find a useful list of wheels here
http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
Sources:
https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/
http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
https://github.com/sightmachine/SimpleCV#windows-7vista
I need to use nltk and numpy with Python. I am a newbie to Python and initially used the python 2.7.3 that came with my mac (currently running OSX 10.7.5). I learned that the apple version of python may not be robust so I downloaded the standard version from python.org.
I have downloaded the nltk program for Mac OSX 10.7. This seemed to install fine. I am trying to download and install numpy using the instructions from the scipy website. http://www.scipy.org/Installing_SciPy/Mac_OS_X.
I cloned numpy from github but when I tried to build it using the following command
$ python setup.py build
I received the following error
MacOS/Python: can't open file 'setup.py': [Errno 2] No such file or directory
I also tried to build it using the scons command
$ python setupscons.py scons --jobs=2
and received the following error
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'setupscons.py': [Errno 2] No such file or directory
Can anyone think of a possible workaround?