Ask coding questions

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

When I try to run the "import this" command in Repl.it, it gives me the following error:
Repl.it: 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

Repl.it: package installation failed!

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

Answered by mat1 (2258) [earned 5 cycles]
View Answer
Commentshotnewtop
2
mat1 (2258)

This is a Repl.it bug. Please report it in the bugs board.
The reason you're getting this is because Repl.it 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!

1
JeetZawab_Ul (2)

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

2
Scoder12 (321)

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

1
a5rocks (502)

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

1
Scoder12 (321)

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

1
JeetZawab_Ul (2)

@Scoder12 but it is not the best answer.