How to use IDLE within a virtual environment?

Asked

Viewed 42 times

-3

When we install Python it automatically installs an IDLE together, but when creating a Virtual Environment it does not install. How do I gain access to IDLE within a virtual environment?

  • 2

    I voted to reopen the question. I honestly did not understand the reason for the negative votes or the closure. For me it is a perfectly valid question.

1 answer

4

No need to install. IDLE is actually a module that comes bundled with Python and, when created the virtual environment, is still available to you.

To run it, simply create and activate your virtual environment:

$ python -m venv venv
$ source ./venv/bin/activate

Then run idle from the command line:

(venv) $ python -m idlelib.idle

So you will run the module idle package idlelib, responsible for the IDLE itself.

Example on Windows with Python 3.9.1:

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.