'Importing Ghostscript on Windows 10

I am trying to import ghostscript into Python

when I type import ghostscript, I get the following error message:

Traceback (most recent call last): File "<pyshell#0>", line 1, in import ghostscript File "C:\Users...\AppData\Local\Programs\Python\Python38-32\lib\site-packages\ghostscript_init_.py", line 35, in from . import _gsprint as gs File "C:\Users...\AppData\Local\Programs\Python\Python38-32\lib\site-packages\ghostscript_gsprint.py", line 505, in raise RuntimeError('Can not find Ghostscript DLL in registry') RuntimeError: Can not find Ghostscript DLL in registry

I am using Windows 10.

I have confirmed I am using Python 3.8.3, 32-bit.

I found this thread: Importing Ghostscript in Python on Windows 8, but it was not very helpful.

Any suggestions?

I'm not sure how to figure out if I'm using ghostscript version 32-bit or 64-bit.

Edit #1:

I installed Ghostscript by doing python -m pip install ghostscript



Solution 1:[1]

According to the documentation, the ghostscript PyPi package requires an existing installation of Ghostscript:

python-ghostscript requires

  • Python 2.7 or higher (tested with Python 2.7, 3.4, 3.6 and 3.6)
  • setuptools for installation (see below)
  • Ghostscript Version 8.x or higher (tested with 9.x)

You can download Ghostscript for Windows from pypi.org or ghostscript.com.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 जलजनक