Skip to content
/ vsvenv Public

A zsh library for easy VSCode Python virtual environment usage.

Notifications You must be signed in to change notification settings

kozzza/vsvenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vsvenv

Visual Studio Code virtual environment manager for Python.

vsvenv is a zsh library that contains functions to easen virtual environment setup and usage in VSCode using the built-in python venv package. Because of this, vsvenv only works for python versions 3.3 and above.

Examples

Installation

For now, you can go to vsvenv.zsh and copy all of the code written there. Then direct to your terminal and make sure you're using z-shell.

Once at the home directory, type in: nano ~/.zshrc and a text-editor should pop up. Paste the copied code at the bottom of the file. Then write out the file with ctrl+o enter ctrl+x. Your .zshrc will now be updated with all of the functionality needed to run vsvenv.

Usage

Virtual Environment Setup

To create a new venv, cd into your desired project directory and type in: vsvenv <python-version> [-d "<directory>"].

If the -d flag is not provided, the program will default to use ./env for the venv. In the case that the selected directory already exists, you will be prompted to replace it with the venv.
After the venv is created, a settings.json file will be created under ./.vscode if it does not already exist. The entry: "python.pythonPath": "env/bin/python" will be added to the json to link your new venv to the python interpreter in VSCode.

You should now be ready to run your python project directly in VSCode using the venv.

About

A zsh library for easy VSCode Python virtual environment usage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages