PyMuPDF ModuleNotFoundError - python

I successfully ran the command:
pip install pymupdf
Successfully installed pymupdf-1.18.15
However, both
import fitz
and import pymupdf
both output an
ModuleNotFoundError.
Why is python giving me a ModuleNotFoundError?

According to PyMuPDF
Documentation
you need to download a wheel file that is specific to your platform
(e.g windows, mac, linux). The wheel files can be found on PyMuPDF
files.
Make sure to check the correct version of your python running on
your system python -V
Once downloaded place it at the root directory of your project.
Then run pip install PyMuPDF-<...>.whl replace PyMuPDF-<...>.whl
with the name of the wheel file you have downloaded in (1) above.
Now import fitz should be available in your module.

Related

How to install Python libraries on Windows without UAC?

So I downloaded the Python embedded files, and put it into %USERPROFILE%\bin\python to run Python files.
Then I downloaded setuptools files from PyPI and tried to install setuptools by using “Python setuptools install”, but it give me the “No module named ‘setuptools’” error.
Is there any way I can install Python libraries on Windows without UAC? Thanks.
I do it the following way:
Download the whl file from PyPi
Open powershell and change to the directory where the whl file is located.
Run pip install setuptools-<version-info>.whl

Unable to install PDFMiner

I am trying to install the PDFMiner library, and after downloading the tar.gz file from
https://pypi.python.org/pypi/pdfminer/
Afterwards, it says to run the setup.py file, but after extracting the files using 7ZIP, for some weird reason there is no setup.py file. I have attached an image of how the extracted folder looks like.
To install PDFMiner, follow these step-
Install python 2.4 or newer. (Python 3.x is not supported.)
Download the PDFMiner source.
Unpack it. (ie. extract the archive)
Run setup.py to install: python setup.py install
That's it!

Python: Install Tesseract for Windows 7

My objective is to use OCR in Python 2.7 using Tesseract on a Windows 7 machine, but I am running into issues as for the installation process. I tried following the instruction here but the link to "tesseract-core-yyyymmdd.exe" and "tesseract-langs-yyyymmdd.exe" do not exist anymore and I can't find these .exe elsewhere online. Here's what I have done so far:
installed tesseract from its executable from official tesseract-ocr page.
installed via pip packages "wand", "PIL", "pyocr".
Now, if I do the following in Python:
from wand.image import Image
from PIL import Image as PI
import pyocr
import pyocr.builders
import io
No problem loading up these packages but pyocr.get_available_tools() gives me an empty list. I am sure this has to do with the missing installation .exe files above. Where can I find them? Is it something else that I am missing?
I just tried to set up pytesseract and it works ! I have windows 10 and python 2.7 installed.
all you need to do :
Download Visual basic C++ from http://aka.ms/vcpython27 and install it (common installation step)
Download tesseract from python via this link https://pypi.python.org/pypi/pytesseract
Unizip the file.
Go to the directory which contains the unizip file
Run this command " python setup.py install "
(Additional) to test if it's installed, go to your python shell and run this command " import pytesseract "
I hope it works !! Note pytesseract is google based OCR, it works similarly to tesseract.
Step [1] To install tesseract kindly visit
https://github.com/UB-Mannheim/tesseract/wiki
The latest installers can be downloaded from here:
e.g., tesseract-ocr-setup-3.05.02-20180621.exe, tesseract-ocr-w32-setup-v4.0.0-beta.1.20180608.exe, tesseract-ocr-w64-setup-v4.0.0-beta.1.20180608.exe (64 bit)
Step [2] Download Microsoft Visual C++ Compiler for Python 2.7 from the link given below
https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi
Step [3] Install pytesseract for binding for tesseract using pip
pip install pytesseract
Step [4] Furthermore you can install an image processing library in python, e.g., pillow:
pip install pillow
greetings!! you are done!! :)
PIP is a package manager for Python packages
Open cmd run pip search "pytesseract", you can see latest version
Run pip install pytesseract for latest version or pip install pytesseract==0.3.0 for version you want.
In windows python cmd run import pytesseract for sure installed was successful.
Install both and you are done
Binaries from:
https://github.com/UB-Mannheim/tesseract/wiki
Python Wrapper from here:
https://pypi.python.org/pypi/pytesseract

Error installing from GitHub using pip on Windows

I am on a Windows machine and I want to install a Python module from GitHub using pip directly from IPython.
The simplest command that seems it should work is:
!pip install https://github.com/japerk/nltk-trainer.git
I have also tried:
!pip install https://github.com/japerk/nltk-trainer.git#egg=nltk-trainer
I've used variants including -vvv, etc.
However, I'm getting the following error. Why?
Cannot determine archive format of C:\Users\timo\AppData\Local\Temp\pip-build-183bwemw\nltk-trainer
go to the https://github.com/japerk/nltk-trainer and download the project zip file. extract the zip file and put it somewhere in your computer.
open command prompt in windows and go inside the folder that you extracted earlier(you must be in the folder that has setup.py file in it).
enter the following command: python setup.py install
python tries to install nltk-trainer . during installation some other dependency might be installed too. you need numpy and scipy to be installed. if any problem happened during installation of numpy or scipy try installing them manually first by using pip install numpy and pip install scipy
if you can't install numpy and scipy using pip command use the following link:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
this site has compiled version of these libraries ( and other libraries if you need to install them too) you can download .whl file that is based on your python version and os architecture and install them using pip install filename.whl command ( you need to be in the folder that your whl file is) for example for python3.4 and 64bit operating system you may download scipy‑0.16.0‑cp34‑none‑win_amd64.whl file.

install pyquery on windows

I want to install pyquery on windows. But i cant run setup.py install on the command line. Do you have any hint?
I guess you don't have lxml or setuptools installed
setuptools
http://pypi.python.org/pypi/setuptools/0.6c11
lxml
http://pypi.python.org/pypi/lxml/2.2.2
Install them first and then try again, I just tried that, its working properly here.
I could not install lxml on windows with either pip or easy_install. Complained "Unable to find vcvarsall.bat"
Tried installing Cygwin and MinGW but that was taking way too long
found out from raidsan's answer about unofficial precompiled windows binaries
http://www.lfd.uci.edu/~gohlke/pythonlibs/
installed and works fine now
SIMPLE WORKING SOLUTION:
I download the tar file here pyquery-1.2.13.tar.gz (https://pypi.python.org/pypi/pyquery#downloads)
I extracted them a folder pyquery-1.2.13 then i pasted myscript.py to this folder pyquery-1.2.13 in my script i have these lines at the very top to include pyquery module and it works!
import pyquery (this file is in pyquery-1.2.13 folder)
from pyquery import *
Done.
I'm using miniconda on Windows and here is how I installed pyQuery :
Download python miniconda from http://conda.pydata.org/miniconda.html
(if you need many libraries at once, consider installing anadonda instead)
Then from the commandline prompt, run the following commands:
conda install lxml
conda install setuptools
Grab the lastest pyQuery source from https://codeload.github.com/gawel/pyquery/zip/master and unzip it to a directory.
Again from the commandline, go to this directory and run :
python setup.py install

Categories

Resources