pdftotext is not getting installed in windows - python-3.x

I am trying to extract data from an invoice. I found invoice2data will do that job. I have pip installed invoice2data.
from invoice2data import extract_data
This is getting imported.
result = extract_data('sample.pdf')
When I run the above line it is showing that
OSError: pdftotext not installed. Can be downloaded from https://poppler.freedesktop.org/
When I try pip installing pdftotext it was showing virtual c++ 14.0 is required.I installed it using build tools. Again it was showing the same error. So I downloaded the files from https://pypi.org/project/pdftotext/ and pasted the extracted files in my anaconda/Lib/sitepackages directory. Now when I try to pip install pdftotext it is showing Requirement already satisfied: pdftotext in c:\users\vicky\anaconda3\lib\site-packages (2.1.2) Now, when I try to extract data from the pdf it is again showing the same error that pdftotext is not installed. How can I overcome this error or is there any other package that will satisfy my requirement?
Thanks in advance.

Install poppler-utils before pdftotext
sudo apt-get install poppler-utils

some simple steps to do, which worked for me...
1. download and install Visual Studio with C++ Build Tools, as Microsoft Visual C++ is required.
https://visualstudio.microsoft.com/downloads/
2. Download the latest binaries of Popplers for Windows
https://blog.alivate.com.au/poppler-windows/index.html
3. Extract and copy the 'poppler' folder which is inside the folder 'include'
4. Past this 'poppler' folder inside the 'Anaconda3/include/' folder
5. Then run 'pip install pdftotext'
YOU ARE DONE!!!

Related

How to install github python files which pip installation is not provided?

I want to install https://github.com/opendoor-labs/pyfin package in windows 10, but no pip installation method is provided in the page. I use vs-code python-3.9.10 and all my libraries are installed in a virtual environment. The git address of all files is https://github.com/opendoor-labs/pyfin.git. but I don't know how to download and install directly to the (venv). Is there any easy way to install and import it to my code? I tried 'pip install pyfin', but it installed other library included in this page : https://pypi.org/project/pyfin/ which is different.
First activate your venv.
(activate it using the .\venv\Scripts\activate command.)
The run pip install git+https://github.com/your/repo

Installing PyAudio gets error: portaudio.h file not found

I am trying to use the SpeechRecognition library, but I get the error PyAudio not installed. I did pip3 install PyAudio, but I get the error portaudio.h file not found. I have tried everything. Downloading the .whl file, installing Visual C++ Build Tools and tried installing through pipwin. Can anyone help me?

How to install wheel package of tensorRT for tensorflow on Windows 10?

From NVIDIA tensorRT documentation I have completed the first 4 steps for zip file for windows.But Now I can't really understand the 5th and 6th step specially where I have to 3 things to get it work for "tensorFlow". I can't understand how to execute this line
python3 -m pip install <installpath>\graphsurgeon\graphsurgeon-0.4.5-py2.py3-none-any.whl
Here is the link: https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing-zip
P.S:I am very new to this world of machine learning and TensorFlow.
You need to open a terminal with a python environment.
Press Ctrl+r and type cmd+Enter to open a terminal. You can check if you have the correct Python version by running python --version.
More information about package installing can be found here:
https://packaging.python.org/tutorials/installing-packages/#requirements-for-installing-packages
For install command execution, replace <installpath> by the location, where you installed TensorRT, e.g., if you installed it in C:\Program Files\TensorRT use:
python3 -m pip install "C:\Program Files"\TensorRT\graphsurgeon\graphsurgeon-0.4.5-py2.py3-none-any.whl
This is described in 2) from your link:
Choose where you want to install TensorRT. The zip file will install
everything into a subdirectory called TensorRT-7.x.x.x. This new
subdirectory will be referred to as <installpath> in the steps below.

ModuleNotFoundError: No module named 'misaka'

In python misaka module not able to install while installing pip install misaka showing download error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Vi
sual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
please suggest the above solution. i checked python version for system 64 same is there.
use following code in your cmd
pip install misaka
to install miska library
some example
from misaka import Markdown, HtmlRenderer
rndr = HtmlRenderer()
md = Markdown(rndr)
print(md('some text'))
Working solution!
Go to https://visualstudio.microsoft.com/downloads/ scroll down one page and download Visual Studio 2017 community.
Go through following link to download the required components for Microsoft Visual C++ 14.0, the link provides what components to be selected while downloading.
https://developercommunity.visualstudio.com/content/problem/409173/error-microsoft-visual-c-140-is-required.html
Once the download finishes, you will be asked to restart your system.
Having restarted your system, type
pip install django-misaka
Hope it works as it worked for me!
you should have install the module using pip
pip install django-misaka

Install OpenCV correctly on macOS Sierra

I am running on macOS Sierra and I have python 3.5.2 installed on my system.
Now I want to use opencv with python. So here is what I did :-
Installed XCode
Installed CMAKE
Downloaded opencv 3.2 and extracted to my Document directory.
Created a new directory called build inside my opencv directory in Document (obtained from step 3)
Opened CMAKE and configured it to run with source as the opencv directory in Document and target as the build directory within it.
Ran the "make" command from "build" directory
Ran "sudo make install"
All these steps completed successfully. Now I go to IDLE 3.5.2 shell and do "import cv2" and then I get the error "ImportError: No module named cv2"
I tried other solutions like pip3 install opencv-python. It removes the import error but I cannot use this because it doesn't support cv2.imshow() (I kind of need it).
Please help me install and configure opencv correctly.
If you are still stuck you can try by brew, did a fresh install some weeks ago and here is the full process.
As opencv cant support python2 & 3 by default install (read further)
brew edit opencv3
in formula edit this part:
if build.with?("python3") && build.with?("python")
# Opencv3 Does not support building both Python 2 and 3 versions
odie "opencv3: Does not support building both Python 2 and 3 wrappers"
end
by commenting it out ( # at start line).
then:
brew reinstall opencv3 --with-contrib --with-python3 --HEAD
if you have cmake.downloader error you need to edit the brew call and remove the --HEAD flag.
This error is just du to a file missing in the head repository (might be fix soon or not).
Also check your site-package/python version
One issue I found was with then name of the .so library created on install. Try renaming it to cv2.so instead of the longer name it starts with.
On my system it's found here:
/usr/local/opt/opencv/lib/python3.6/site-packages
Also, you can confirm that the above site-packages folder is accessible via sys.path.
>>> import sys
>>> sys.path
If not, you can create a .pth file in one of those directories that contains simply the path name of your site-packages folder above.

Resources