0

I have two python versions installed for some reason: 3.7.7 32-bit and 3.7.8 64-bit. The specific line from PIL import Image brings different errors. In 64-bit, I get this error:

Traceback (most recent call last):
    File "equinox.py", line 20, in <module>
        from PIL import Image, ImageOps,ImageFont, ImageDraw, ImageEnhance
      File "C:\Users\FAMILY\AppData\Roaming\Python\Python37\site-packages\PIL\ImageEnhance.py", line 21, in <module>
        from . import Image, ImageFilter, ImageStat
      File "C:\Users\FAMILY\AppData\Roaming\Python\Python37\site-packages\PIL\ImageFilter.py", line 20, in <module>
        import numpy
      File "C:\Users\FAMILY\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 138, in <module>
        from . import _distributor_init
      File "C:\Users\FAMILY\AppData\Roaming\Python\Python37\site-packages\numpy\_distributor_init.py", line 26, in <module>
        WinDLL(os.path.abspath(filename))
      File "C:\Users\FAMILY\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 364, in __init__
        self._handle = _dlopen(self._name, mode)
    OSError: [WinError 193] %1 is not a valid Win32 application

and in 32-bit I get this error: ImportError: cannot import _imaging from PIL when it tries from . import _imaging as core.

I tried fixing both problems by reinstalling Python, reinstalling Pillow, deleting leftover PIL folders, checking for any files in the directory that is named _imaging PIL Pillow Image but nothing.

Can anyone help?

martineau
  • 119,623
  • 25
  • 170
  • 301
walid
  • 77
  • 10
  • in every version you should install different version of `pillow`. If you don't have separated `pip` for both Pythons then you should use `python -m pip install pillow` for both versions – furas Aug 21 '20 at 23:44
  • I tried, still doesnt work. I get `Requirement already satisfied: pillow in c:\users\family\appdata\roaming\python\python37\site-packages (7.2.0)` – walid Aug 21 '20 at 23:56
  • if you have two Pythons installed then you have to install `pillow` also two times - and you have to use different `python` - `path/to/32bit/python -m pip install pillow` and `path/to/64bit/python -m pip install pillow`. – furas Aug 22 '20 at 00:15
  • it says requirement already satisfied in both version – walid Aug 22 '20 at 00:43
  • I have no idea what is problem – furas Aug 22 '20 at 01:01
  • Does this question address your problem? https://stackoverflow.com/questions/59028071/oserror-winerror-193-1-is-not-a-valid-win32-application-while-running-numpy – Weeble Aug 22 '20 at 01:21
  • sadly it doesnt @Weeble – walid Aug 22 '20 at 03:30

0 Answers0