Error installing pgi package in python 3.8

1.1k views Asked by At

I am new to programming and for a school project, I need to install pgi 0.0.11.2 package from PyPi. Whenever I try to install the package I get the following error:

Collecting pgi
  Using cached pgi-0.0.11.2.tar.gz (239 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\user\AppData\Local\Temp\pip-install-5ymvp6rm\pgi_e8fc2c7d05e54b1083386e9ca52df18f\setup.py", line 18, in <module>
          import pgi
        File "C:\Users\user\AppData\Local\Temp\pip-install-5ymvp6rm\pgi_e8fc2c7d05e54b1083386e9ca52df18f\pgi\__init__.py", line 10, in <module>
          from .importer import require_version, get_required_version
        File "C:\Users\user\AppData\Local\Temp\pip-install-5ymvp6rm\pgi_e8fc2c7d05e54b1083386e9ca52df18f\pgi\importer.py", line 15, in <module>
          from .clib.gir import GIRepository
        File "C:\Users\user\AppData\Local\Temp\pip-install-5ymvp6rm\pgi_e8fc2c7d05e54b1083386e9ca52df18f\pgi\clib\gir\__init__.py", line 8, in <module>
          from .giargument import GIArgument
        File "C:\Users\user\AppData\Local\Temp\pip-install-5ymvp6rm\pgi_e8fc2c7d05e54b1083386e9ca52df18f\pgi\clib\gir\giargument.py", line 9, in <module>
          from ..glib import gboolean, gint8, guint8, gint16, guint16, gint32, guint32
        File "C:\Users\user\AppData\Local\Temp\pip-install-5ymvp6rm\pgi_e8fc2c7d05e54b1083386e9ca52df18f\pgi\clib\glib.py", line 16, in <module>
          _glib = find_library("glib-2.0")
        File "C:\Users\user\AppData\Local\Temp\pip-install-5ymvp6rm\pgi_e8fc2c7d05e54b1083386e9ca52df18f\pgi\clib\_utils.py", line 99, in find_library
          _internal[name] = cdll.LoadLibrary(_so_mapping[name])
        File "c:\users\user\appdata\local\programs\python\python38\lib\ctypes\__init__.py", line 447, in LoadLibrary
          return self._dlltype(name)
        File "c:\users\user\appdata\local\programs\python\python38\lib\ctypes\__init__.py", line 369, in __init__
          self._handle = _dlopen(self._name, mode)
      FileNotFoundError: Could not find module 'libglib-2.0-0.dll'. Try using the full path with constructor syntax.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Following the error, I tried manually registering libglib-2.0-0.dll following this link. It still gives me the same error.

I have tried to use conda to install pgi but it was no use. I am working on 64-it Windows.

I am actively having a meltdown. I would appreciate any suggestion.

1

There are 1 answers

0
Bikram Adhikari On

I was able to solve creating a conda environment and installing the libglib through conda first:

conda install -c conda-forge libglib