Ask coding questions

← Back to all posts
Importing "this" in Python 🐍
JeetZawab_Ul (2)

When I try to run the "import this" command in, it gives me the following error: Installing fresh packages

Collecting this
ERROR: Could not find a version that satisfies the requirement this (from versions: none)
ERROR: No matching distribution found for this package installation failed!

Can you please explain me why this issue is occurring?
Looking forward to hear from you.

Answered by mat1 (2866) [earned 5 cycles]
View Answer
mat1 (2866)

This is a bug. Please report it in the bugs board.
The reason you're getting this is because is attempting to install the nonexistent "this" library from PyPI. You can still import this if you do __import__('this')
Please mark my comment as the answer if it helped. Thanks!

JeetZawab_Ul (2)

@mat1 Thank you very much. It worked. And I reported the bug as well.

Scoder12 (372) is trying to auto install the package. If you want to try import this, type it in the console!

a5rocks (577)

@JeetZawab_Ul yep, the easter egg is definitely great! the zen of python xd

Scoder12 (372)

@JeetZawab_Ul can you mark my comment as the answer? I would really appreciate it!

JeetZawab_Ul (2)

@Scoder12 but it is not the best answer.