Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The module name is incorrect #7153

Closed
ezequielsobrino opened this issue May 10, 2023 · 3 comments
Closed

The module name is incorrect #7153

ezequielsobrino opened this issue May 10, 2023 · 3 comments

Comments

@ezequielsobrino
Copy link

I ran a python file, got a message that the PIL module did not exist, tried to install PIL but it didn't exist and had to Google to discover the name 'Pillow'.

log console

(venv) E:\repos\promptflow>python run.py
Traceback (most recent call last):
  File "E:\repos\promptflow\run.py", line 1, in <module>
    from promptflow.__main__ import main
  File "E:\repos\promptflow\promptflow\__main__.py", line 3, in <module>
    from promptflow.src.app import App
  File "E:\repos\promptflow\promptflow\src\app.py", line 14, in <module>
    from PIL import Image, ImageTk
ModuleNotFoundError: No module named 'PIL'

(venv) E:\repos\promptflow>pip3 install PIL
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL

(venv) E:\repos\promptflow>pip install PIL
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL

(venv) E:\repos\promptflow>pip install Pillow
Collecting Pillow
  Using cached Pillow-9.5.0-cp311-cp311-win_amd64.whl (2.5 MB)
Installing collected packages: Pillow
Successfully installed Pillow-9.5.0
@radarhere
Copy link
Member

radarhere commented May 10, 2023

Hi. Pillow is actually a fork of PIL. You can see them as two distinct packages on PyPI - https://pypi.org/project/PIL/ and https://pypi.org/project/Pillow/ - and Pillow is maintained by a different group of people to those that created PIL.

You can learn more at https://pillow.readthedocs.io/en/stable/about.html and https://pillow.readthedocs.io/en/stable/porting.html. PIL doesn't support Python 3, so that would be why you were unable to install it.

The particular scenario you encountered is one where you somehow bypassed requirements.txt when installing a library - https://github.com/InsuranceToolkits/promptflow/issues/3. I imagine that the name 'PIL' was chosen for our module to make it clear that we were connected to the original package, and to simplify porting code to Pillow. If you just think that pip install PIL should work, we already have an issue open for discussion of that - #1535

@radarhere
Copy link
Member

radarhere commented May 11, 2023

@ezequielsobrino did that answer your question?

If you're requesting that Pillow change module name from 'PIL' to 'Pillow', you understand that is a large change, that would require all users of Pillow to update their code. While you may feel that this simplifies things, others might feel like this is an unnecessary change. It is difficult to balance both.

@github-actions
Copy link

Closing this issue as no feedback has been received.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants