OCRmyPDF throws [WinError 2] The system cannot find the file specified - python

I've got a strange error: as soon as I run OCRmyPDF (inside Python or cmd), my output is stuffed with the following error message:
[WinError 2] The system cannot find the file specified
Even through the "verbosity=True" option in the logger, I get no indication of the origin of the error message (I get this error already when I only import the library). Also, the function does exactly what it is supposed to do and the process completes with exit code 0.
Does anybody know, what could be wrong there?
Best,
Kevin

Please follow the following two steps
Install camelot-py from https://pypi.org/project/camelot-py/.
Then after install Ghostscript from https://www.ghostscript.com/download/gsdnld.html and add in environment variables.
NOTE: Add the following path in computer environment variables
C:\Program Files\gs\gs9.54.0\bin
C:\Program Files\gs\gs9.54.0\lib
Then after restart your computer, then problem fixed.
NOTE: But if you still face an error, make sure you have install ocrmypdf version 12.2.o by command. pip install ocrmypdf==12.2.0
Thank you

The OCRMyPDF library depends heavily on some packages that are not available on windows by default. Tesseract (https://tesseract-ocr.github.io/tessdoc/), GhostScript (https://www.ghostscript.com/) and Unpaper for instance. You need to ensure they are installed and available in your path. Using a package manager like chocolatey can make getting these packages installed a straightforward process.

Related

Have difficulty to solve "No module named pkg_resources"

Hope someone can help me! I appreciate it.
I tried to download some open source from GitHub, but it shows "No module named pkg_resources".
Then I searched some solution from No module named pkg_resources , but it showed the error below. I also found some solution from other articles, but it still not working.
Installing Setuptools
running install
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/test-easy-install-48274.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://setuptools.readthedocs.io/en/latest/easy_install.html
Please make the appropriate changes for your system and try again.
Something went wrong during the installation.
See the error message above.
p.s. I couldn't open that link in the error messages https://setuptools.readthedocs.io/en/latest/easy_install.html.
By the way, I've checked my pip version and it also showed "No module named pkg_resources". I'm confused because I use Python for like 1-2 years, and everything goes fine, but I just found this error message today. If I couldn't solve this problem, it might be a huge trouble because I can't download everything about "Pip".
Probably the easiest solution would be to download get-pip.py, then run it using sudo:
sudo python3 get-pip.py
assuming you have admin permissions on your computer. easy_install has been deprecated for a long time, and pip is definitely the way to go. By reinstalling pip, setuptools and all its dependencies should be correctly installed as well.

‘pip install pybullet’ causes error “cannot open input file ‘Ws2_32.lib’”

When pip install pybullet is entered into the command prompt, the wheel fails to build and “errors out with exit status 1” then after a long list of red text it says: LINK : fatal error LNK1181: cannot open input file ‘Ws2_32.lib’ before trying and failing to build the wheel again with the same error. What does this mean and how can I fix it?
My first problems were the same as the ones in this question but I resolved those by adding the file locations to the path. I was going to try the same solution with this problem but I could not find Ws2_32 on the computer. I think this has something to do with it being an input file. There are several files named WS2_32 (where the s is capitalized) that are in similar places to the other files I needed to add to PATH but adding them to the path or LIB does not change anything. I have tried most of the solutions I have found online, though there are not many. I just do not know how to make sure the computer can find a file that I can’t. Does this mean I just don’t have it? Is there anywhere I can download it? I have also restarted the computer several times.
I have installed pybullet successfully on another computer and I have tried to make my Visual Studio installation look similar (pybullet requires Visual Studio).
I am using Python 3.6 64bit, Pip is upgraded, and Windows 7. The only difference that I think might matter between the two computers is that the successful one runs Windows 10. I can provide more information if it is needed. Thanks for the help.
I installed pybullet in VS Code without wheel installed and it gets installed successfully.
Maybe try installing it without using wheel.

Can't load audio files with librosa

Unless I use one of librosa's native 'example' audio files which are in some format '.ogg', I cannot load audio.
Every github issue and SO answer says I need to install ffmpeg. I found a python package called ffmpeg and installed it into my virtual environment. I also found some sort of multi-purpose program called ffmpeg and installed it onto my Windows machine, and added it's location to my PATH variable.
I still get the same warnings and errors that everyone else is getting:
c:\users\wesle\appdata\local\programs\python\python38\lib\site-packages\librosa\core\audio.py:162: UserWarning: PySoundFile failed. Trying audioread instead.
warnings.warn("PySoundFile failed. Trying audioread instead.")
---------------------------------------------------------------------------
.
.
.
115 # All backends failed!
--> 116 raise NoBackendError()
I can find no resolution for this problem despite the number of people asking for help on it.
I don't know what fileformat you are trying to load, but in most cases installing ffmpeg is the solution to this problem. It is important to add the "../bin/" directory to PATH and restart the environment. Using the "set" command from prompt you can check that the current path contains the folder.

ERROR: Could not install packages due to an EnvironmentError: [Errno 9] Bad file descriptor

I try to install virtualenvwrapper-win module,and do:
pip install virtualenvwrapper-win"
It showed the error in the last line:
ERROR: Could not install packages due to an EnvironmentError: [Errno 9] Bad file descriptor
I've completely reinstalled python and updated to latest versions and checked version 64 - bit.
I had the same problem with the installation of gdown package from pip.
screenshot of the error I was getting
But then, I figured out that the actual problem was with my antivirus. Try the following steps -
Open terminal with admin access.
Try disabling your antivirus.
Check Internet connection.
Try restarting your computer.
Any of the above measures should work. Mine had the problem with the antivirus.
Try using pip3 install virtualenvwrapper-win
EnvError and OSerror are brought back when python is not involved, so it is our OS that must present inconsistencies for it (in the processes for example) even if the message returned by python is earlier vague. Here's what I did for me. I just downloaded the iso of my OS, ran it to redo my system. With the option to keep my programs installed I always had the same python error so I had to separate myself from all my installed programs except my drivers and my personal files (music, videos, etc.) managed automatically by this repair mode. If not there's also the Windows Dism tool that could help, well I think, I didn't manage to use it because of its error codes that I found interminable. it allows you to repair windows system files you could know more about it and the method I used on their official website and on other third party sites. When has the cause of this problem, I think it's due to a malware that is installed on your system and that modifies the behavior of your OS, because I had unfortunately installed one on my pc the day the python error appeared. I hope I have helped. My OS is Win 8.1

python-docx won't install ERROR conda.core.link:_execute(700)

Not sure what is going on here, but I get the following error when trying to install python-docx on my server:
ERROR conda.core.link:_execute(700): An error occurred while installing package 'conda-forge::lxml-4.5.0-py38hbb43d70_1'.
[Errno 13] Pewrmission denied: '.../anaconda3/envs/django_env/lib/python3.8/site-packages/lxml/ElementInclude.py
The thing is, there is no such file that I can find in that location, so not sure what this is all about, any help would be appreciated, I've not found anything at all on google relating to this.
This is now solved, but my solution was to uninstall Anaconda and reinstall it. This error occurred because the original error advised me to rename or manually delete the ElementInclude.py file. So I did that knowing it was only the Anaconda distribution not a linux system file, but it broke the my website anyway. The fault initially cropped up, as we were trying to use Anaconda on another account whilst it was installed on my account. Anaconda3 is now installed in root so that it is accessible by all users now. I still had to set it to PATH on each of the two accounts that wanted access, but doing that python-docx installed with no issues.

Categories

Resources