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.

Wrong Python inside of 'pipenv shell'

See original GitHub issue

Inside of the pipenv shell subshell, I expected python to point to .venv/bin/python, but:

$ pipenv --version
pipenv, version 3.3.2

$ pipenv shell
Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.

$ which python
/Users/Browning/.pyenv/shims/python

$ which -a python
/Users/Browning/.pyenv/shims/python
/Users/Browning/.local/share/virtualenvs/virtualboombox/bin/python
/Users/Browning/.pyenv/versions/3.6.0/bin/python
/Users/Browning/.pyenv/shims/python
/usr/local/bin/python
/usr/bin/python

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
uranusjrcommented, Sep 25, 2018

Or maybe you should move pyenv init into .bash_profile instead (I am not sure what is zsh’s equivalent). profile is for login shells, and only evaluated once; rc is for non-login shells. pipenv shell launches non-login shells.

1reaction
FlorianKempenichcommented, Sep 25, 2018

@uranusjr This is genius!!

I just tested, it works as expected and feels much cleaner than my version. For reference the zsh equivalent of .bash_profile is .zlogin: http://zsh.sourceforge.net/Intro/intro_3.html

Thanks for teaching me about login vs interactive shells. I’m switching to your version 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipenv using wrong python with pyenv · Issue #729
pipenv is using python 3.5.3 instead of 3.6.2 for some reason $ pipenv --version ... run the following: $ pipenv shell $ pyenv...
Read more >
Why is pipenv telling me the wrong version of python?
It scans your system and looks for a compatible python installation. Now, it seems you already have an existing Pipfile that has "2.7"...
Read more >
Frequently Encountered Pipenv Problems - Read the Docs
☤ My pyenv-installed Python is not found​​ Make sure you have PYENV_ROOT set correctly. Pipenv only supports CPython distributions, with version name like...
Read more >
Using Python environments in VS Code
Using Python environments in VS Code. This article discusses the helpful Python environments features available in Visual Studio Code. An "environment" in ...
Read more >
Pipenv
Create a new project using Python 3.7, specifically: $ pipenv --python 3.7 Remove project virtualenv (inferred from current directory): $ pipenv --rm ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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