question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot add "Pillow" package dependency through interactive init

See original GitHub issue
  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Windows 10 x64 2004

  • Poetry version: 1.1.4

  • Link of a Gist with the contents of your pyproject.toml file: not relevant

Issue

Hi, I tried to interactively create a new project with some existing python files using poetry init. However I found some sad behaviour when trying to interactively specify packages I wanted.

I couldn’t add the Pillow package. Adding matplotlib worked fine. I think you can see the issue from the terminal output…

Search for package to add (or leave blank to continue): matplotlib
Found 20 packages matching matplotlib

Enter package # to add, or the complete package name if it is not listed:
 [0] matplotlib
 [1] jirafs-matplotlib
 [2] matplotlib-helper
 [3] matplotlib-venn
 [4] chineseize-matplotlib
 [5] matplotlib-colorbar
 [6] django-matplotlib
 [7] matplotlib-pgfutils
 [8] matplotlib-stream
 [9] matplotlib-helpers
 > 0
Enter the version constraint to require (or leave blank to use the latest version):
Using version ^3.3.4 for matplotlib

Add a package: Pillow
Found 20 packages matching Pillow

Enter package # to add, or the complete package name if it is not listed:
 [0] Pillow3f
 [1] pillow-lut
 [2] pillow-affine
 [3] pillow-scripts
 [4] pillow-snippet
 [5] pillow-tools
 [6] Pillow-PIL
 [7] pillow-stackblur
 [8] Pillow-SIMD
 [9] images2gif-Pillow
 > pillow
Value "pillow" is invalid

Enter package # to add, or the complete package name if it is not listed:
 [0] Pillow3f
 [1] pillow-lut
 [2] pillow-affine
 [3] pillow-scripts
 [4] pillow-snippet
 [5] pillow-tools
 [6] Pillow-PIL
 [7] pillow-stackblur
 [8] Pillow-SIMD
 [9] images2gif-Pillow
 > Pillow
Value "Pillow" is invalid

Enter package # to add, or the complete package name if it is not listed:
 [0] Pillow3f
 [1] pillow-lut
 [2] pillow-affine
 [3] pillow-scripts
 [4] pillow-snippet
 [5] pillow-tools
 [6] Pillow-PIL
 [7] pillow-stackblur
 [8] Pillow-SIMD
 [9] images2gif-Pillow
 >
(env) C:\Users\Matthew\code\orbits>

So confusingly, the normal Pillow package was nowhere to be found, and apparently writing the complete package name “Pillow” as instructed is invalid?

I would also like to add that there is no instructions on how to (manually?) finish adding package dependencies. I pressed control+C at the end hoping to continue to the next step, but it killed the whole process.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
teauxfucommented, Feb 18, 2021

I’m also having this issue, and was unsuccessful finding a similar ticket.

Edit: FWIW poetry add Pillow worked just fine 👍

0reactions
mkniewallnercommented, May 28, 2022

Duplicate of https://github.com/python-poetry/poetry/issues/3434, which has been closed since the issue appears to have been fixed in 1.2.0b1.

For the other issue mentioned ('NoneType' object has no attribute 'replace'), I’ve just tested on latest version from master branch, and it does seem to have been fixed, meaning you can now exit dependency adding by typing an empty choice for the selection, then an empty choice for the package name to go the next question:

Search for package to add (or leave blank to continue): Pillow
Found 20 packages matching Pillow
Showing the first 10 matches

Enter package # to add, or the complete package name if it is not listed []:
 [ 0] Pillow
 [ 1] Pillow3f
 [ 2] pillow-lut
 [ 3] pillow-mbm
 [ 4] pillow-jpls
 [ 5] Pillow-PIL
 [ 6] pillow-affine
 [ 7] pyme-pillow
 [ 8] pillow-heif
 [ 9] pillow-scripts
 [10] 
 > 
No package selected

Add a package:

Would you like to define your development dependencies interactively? (yes/no) [yes]
Read more comments on GitHub >

github_iconTop Results From Across the Web

pip install pillow doesn't work on windows 11 - Stack Overflow
Adding --prefer-binary to pip install might help. Reason for the failure seems to be that pillow requires zlib headers during the compilation ( ......
Read more >
Using Python libraries with AWS Glue
AWS Glue uses PySpark to include Python files in AWS Glue ETL jobs. You will want to use --additional-python-modules to manage your dependencies...
Read more >
Installation - Pillow (PIL Fork) 9.3.0 documentation
Pillow and PIL cannot co-exist in the same environment. ... There are Dockerfiles in our Docker images repo to install the dependencies for...
Read more >
Installing Python Packages from a Jupyter Notebook
I most often see this manifest itself with the following issue: I installed package X and now I can't import it in the...
Read more >
Could Not Find or Load Main Class in Java - Javatpoint
Solution to the Error. To avoid or resolve the error, we need to specify the absolute package name or class name. Without Package....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found