0
import doc2txt

I want to extract the string from the document file with Doc2txt it's give the following error.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/doc2text/__init__.py", line 7, in <module>
    import PythonMagick
ImportError: No module named 'PythonMagick'
A. STEFANI
  • 6,707
  • 1
  • 23
  • 48
Jay Pratap Pandey
  • 352
  • 2
  • 9
  • 19
  • May be 'PythonMagick' is not installed. pip it or install manually after downloading. then try again – lat long Dec 07 '17 at 08:51
  • @latlong Can you tell me how i install PythonMagick in python3 in Ubuntu – Jay Pratap Pandey Dec 07 '17 at 09:22
  • check for 'sudo apt-get install python-pythonmagick' in terminal or search for something like it – lat long Dec 07 '17 at 09:47
  • it doesn't work in python3 – Jay Pratap Pandey Dec 07 '17 at 09:53
  • In a terminal first enter `pip3 search pythonmagick` to determine the correct name on your repository. Then try and enter `sudo pip3 install actual_name_of_pythonmagick`. – Sven-Eric Krüger Dec 07 '17 at 10:04
  • PythonMagick (0.5) - Wrapper around GraphicsMagick PythonMagickWand (0.2) - Python wrapper for the ImageMagick wand API – Jay Pratap Pandey Dec 07 '17 at 10:09
  • But when i install with sudo pip3 install PythonMagick it shows the error:Could not find a version that satisfies the requirement PythonMagick (from versions: ) No matching distribution found for PythonMagick You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. – Jay Pratap Pandey Dec 07 '17 at 10:10

2 Answers2

0

You can install the whl package manually if pip gives you problems.

Whl package:

https://www.lfd.uci.edu/~gohlke/pythonlibs/#pythonmagick

Select the version that you`d like to install

Usage:

pip install <whl file>

F. Leone
  • 594
  • 3
  • 14
0

Open a terminal first, then:

sudo apt-get install python-magic

or

pip3 install --user python-magic

It will install what you need.

You can take a look here to see how use python-magic

Regards

A. STEFANI
  • 6,707
  • 1
  • 23
  • 48
  • istall successfully but didn't work.Installing collected packages: python-magic Successfully installed python-magic-0.4.15 import PythonMagic Traceback (most recent call last): File "", line 1, in ImportError: No module named 'PythonMagic' – Jay Pratap Pandey Dec 07 '17 at 11:14
  • Take a look here https://stackoverflow.com/questions/25286176/how-to-use-python-magic-5-19-1 – A. STEFANI Dec 07 '17 at 12:04