Skip to content

ImportError: cannot import name 'ImageTk' from 'PIL' #45

@Cavorticus

Description

@Cavorticus

Describe the bug
Error received when running 'python main.py --help' or 'python3 main.py --help' per installation instructions.
I have Python v2.7.18 and Python v3.9.2

To Reproduce
Install instructions list the following command to test:
'python main.py --help'

Expected behavior
The expected behavior is to display the Lucifer help information:
_Usage: main.py [-h] [-l LOGGER_LOC] [-g] [-a] [-S] [-T]

Lucifer

optional arguments:
-h, --help show this help message and exit
-l LOGGER_LOC, --log-commands LOGGER_LOC
Enables Command Logging To File
-g, --gui Enables The Gui Mode
-a, --auto-set-vars Enables Auto Setting of Vars On Module Load
-S, --skip-requirements-check
Skips the checking of requirements within lucifer
-T, --test Runs all the lucifer tests_

Solution
For Python v2
sudo apt-get install python-imaging python-pil.imagetk

For Python v3
sudo apt-get install python3-pil python3-pil.imagetk

For Archlinux:
sudo pacman -S python-pillow

It will install the package and you can use it: from PIL import ImageTk

Desktop (please complete the following information):

  • OS: Kali Linux
  • Version: 2021.1
  • Extra Additional Info: Python v2.7.18 and Python v3.9.2

After updating 'python3-pil python3-pil.imagetk', was able to run --help with Python3. Was not able to run using Python v2 even after update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions