question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add an equivalent of `workon` from virtualenvwrapper

See original GitHub issue

Workon does two things. When executed with no args, it lists all available projects (i.e. venvs).

More helpfully, it streamlines the activation process when opening a new shell. This is super useful if you have dozens of projects you work on regularly. A possible syntax for pipenv could look like this:

~ $ pipenv work
blog
django
requests
supersecretproject
pipenv
~ $ pipenv work requests
Moving you to the requests project and activating the shell
(requests) ~/code/requests $

(PS1’s might not be right for pipenv behaviour, but you get the idea.

This streamlines the developers’ flow from:

cd code/requests
pipenv shell

to just:

pipenv work requests

It’s a minor enhancement but something I’d miss moving from virtualenvwrapper.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:27
  • Comments:27 (14 by maintainers)

github_iconTop GitHub Comments

19reactions
ashwinviscommented, Feb 28, 2018

@kennethreitz @fweidemann14 @kblicharski, I finally understood. Here is a short rosetta, for someone who is as new to pew and pipenv as me.

virtualenvwrapper + pip pew + pipenv
mkvirtualenv pew new
cpvirtualenv pew cp
lsvirtualenv pew ls
workon pew workon
deactivate Ctrl + D / exit
pip install pipenv install

A few gotchas:

  • The cdproject equivalent from virtualenvwrapper is missing. But pew setproject can do the change to directory once.
  • pew new does not have a --system-site-packages option. Instead there is a separate pew toggleglobalsitepackages command.
13reactions
filipweidemanncommented, Feb 12, 2018

@kennethreitz Is this feature still a thing? I really love Pipenv and recently converted all my projects, but an equivalent to virtualenvwrapper’s workon would really add that last bit of luxury to it. You should consider adding it 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation — virtualenvwrapper 4.8.5.dev15 documentation
WORKON_HOME tells virtualenvwrapper where to place your virtual environments. The default is · $HOME/.virtualenvs . If the directory does not exist when ...
Read more >
Virtualenvwrapper - Read the Docs
virtualenvwrapper is a set of extensions to Ian Bicking's virtualenv tool. The extensions include wrappers for creating and deleting virtual environments and ...
Read more >
Command Reference - Virtualenvwrapper - Read the Docs
Create a new virtualenv in the WORKON_HOME directory. ... A unique virtualenv name is generated. If -c or --cd is specified the working...
Read more >
Tips and Tricks — virtualenvwrapper 4.8.5.dev15 documentation
In the postmkvirtualenv script I have the following to create a directory based on the project name, add that directory to the python...
Read more >
virtualenvwrapper Documentation
(env2)$ echo 'pip install sphinx' >> $WORKON_HOME/ ... Switch from a virtual environment to the system-installed version of Python. Syntax:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found