Skip to content

Instantly share code, notes, and snippets.

@dmgl
Last active January 30, 2020 16:16
Show Gist options
  • Save dmgl/b07122d8aa5f3c538b7d to your computer and use it in GitHub Desktop.
Save dmgl/b07122d8aa5f3c538b7d to your computer and use it in GitHub Desktop.
How to launch Idle from virtualenv
#!/usr/bin/env python
from idlelib.PyShell import main
if __name__ == '__main__':
main()
#!/bin/bash
# This hook is run after a new virtualenv is created and before it is activated.
# argument: name of new environment
cp /path_to_idle/idle.py $1/bin/
# after command $ source bin/activate in ENV
(ENV)user@system:~/pathtoenv$ cd bin/
# copy idle.py to virtualenv bin/ path, pun
(ENV)user@system:~/pathtoenv$ idle.py
# or use premkvirtualenv file with virtualenvwrapper
# no need to copy idle.py each time before make env
@earthbound19
Copy link

To run it and be able to continue using the terminal that launched it on Mac (you have to press Command+C in the terminal to use the terminal again):

python -m idlelib &

@OMGdaDPS
Copy link

OMGdaDPS commented Dec 7, 2019

for some reason, after creating a venv with python3 -m venv /dir/that/iwant/specificproject/, then sourcing the venv, and trying to run python -m idlelib gives me this error: /home/dps/.venv/testing/bin/python: No module named idlelib

im new to this, so that could be whats wrong lol.

and i dont know if this was the right place to put this, i just came across this github page from a google search looking for an answer to my issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment