Artwork

Content provided by HPR Volunteer and Hacker Public Radio. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by HPR Volunteer and Hacker Public Radio or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!

HPR2333: VirtualenvWrapper for Fish Shell

 
Share
 

Archived series ("Inactive feed" status)

When? This feed was archived on February 10, 2021 18:12 (3y ago). Last successful fetch was on February 26, 2021 20:39 (3y ago)

Why? Inactive feed status. Our servers were unable to retrieve a valid podcast feed for a sustained period.

What now? You might be able to find a more up-to-date version using the search function. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 182646078 series 49648
Content provided by HPR Volunteer and Hacker Public Radio. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by HPR Volunteer and Hacker Public Radio or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.

In this episode, talk about how I created my own virtualenvwrapper-like interface using Fish Shell.

Fish Shell is "a smart and user-friendly command line shell for macOS, Linux, and the rest of the family. It excels in tab completion and ease of use, but virtualenvwrapper does not support it.

Virtualenvwrapper, like the name suggests, is a wrapper around python's virtualenv functionality, which allows you to use different versions of python packages in separate environments. To learn more, listen to BJB's show called A bit of background on virtualenvwrapper.

Functions and aliases in my fish config file:

# Set virtual directory root export set WORKON_HOME=$HOME/Envs # List virtual environments alias lsenvs="ls -m $WORKON_HOME | sed 's/\///g'" # Create python2 virtual environment function -d "Like virtualenvwrapper for python2" mkvirtualenv2 virtualenv -p python2 $WORKON_HOME/$argv; and source $WORKON_HOME/$argv/bin/activate.fish; and echo "Virtual environment created." end # Create python3 virtual environment function -d "Like virtualenvwrapper" mkvirtualenv virtualenv -p python3 $WORKON_HOME/$argv; and source $WORKON_HOME/$argv/bin/activate.fish; and echo "Virtual environment created." end # Source a virtual environment function workon source $WORKON_HOME/$argv/bin/activate.fish; and echo "Switch to virtual environment." end # Delete a virtual environment function -d "Like virtualenvwrapper" rmvirtualenv if test -n "$VIRTUAL_ENV" deactivate end rm -rf $WORKON_HOME/$argv; and echo "Virtual environment deleted." end
  continue reading

3280 episodes

Artwork
iconShare
 

Archived series ("Inactive feed" status)

When? This feed was archived on February 10, 2021 18:12 (3y ago). Last successful fetch was on February 26, 2021 20:39 (3y ago)

Why? Inactive feed status. Our servers were unable to retrieve a valid podcast feed for a sustained period.

What now? You might be able to find a more up-to-date version using the search function. This series will no longer be checked for updates. If you believe this to be in error, please check if the publisher's feed link below is valid and contact support to request the feed be restored or if you have any other concerns about this.

Manage episode 182646078 series 49648
Content provided by HPR Volunteer and Hacker Public Radio. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by HPR Volunteer and Hacker Public Radio or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.

In this episode, talk about how I created my own virtualenvwrapper-like interface using Fish Shell.

Fish Shell is "a smart and user-friendly command line shell for macOS, Linux, and the rest of the family. It excels in tab completion and ease of use, but virtualenvwrapper does not support it.

Virtualenvwrapper, like the name suggests, is a wrapper around python's virtualenv functionality, which allows you to use different versions of python packages in separate environments. To learn more, listen to BJB's show called A bit of background on virtualenvwrapper.

Functions and aliases in my fish config file:

# Set virtual directory root export set WORKON_HOME=$HOME/Envs # List virtual environments alias lsenvs="ls -m $WORKON_HOME | sed 's/\///g'" # Create python2 virtual environment function -d "Like virtualenvwrapper for python2" mkvirtualenv2 virtualenv -p python2 $WORKON_HOME/$argv; and source $WORKON_HOME/$argv/bin/activate.fish; and echo "Virtual environment created." end # Create python3 virtual environment function -d "Like virtualenvwrapper" mkvirtualenv virtualenv -p python3 $WORKON_HOME/$argv; and source $WORKON_HOME/$argv/bin/activate.fish; and echo "Virtual environment created." end # Source a virtual environment function workon source $WORKON_HOME/$argv/bin/activate.fish; and echo "Switch to virtual environment." end # Delete a virtual environment function -d "Like virtualenvwrapper" rmvirtualenv if test -n "$VIRTUAL_ENV" deactivate end rm -rf $WORKON_HOME/$argv; and echo "Virtual environment deleted." end
  continue reading

3280 episodes

All episodes

×
 
Loading …

Welcome to Player FM!

Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.

 

Quick Reference Guide