pipenv: The cousin of pipenv shell doesn't activate env
I somehow doubt this is an issue with pipenv
, as it works as expected on the Windows7 machine at work. But on my OSX 10.12.6, with pyenv
-installed pythons and homebrew-installed pipenv
, issues arise:
I create a .venv with pipenv
and run pipenv shell
, but the virtual environment doesn’t activate… python
and pip
are still the global commands.
I could use some help figuring what I did wrong.
Please run $ python -m pipenv.help
, and paste the results here.
/usr/bin/python: No module named pipenv
(This is output after pipenv shell
)
Expected result
Running pipenv shell
should let you run python
and pip
being the commands from within the environment.
Actual result
python
and pip
use the global commands.
Steps to replicate
Provide the steps to replicate (which usually at least includes the commands and the Pipfile).
~ » mkdir temp
~ » cd temp
temp » pipenv --python 3.6
Creating a virtualenv for this project…
Using /usr/local/bin/python3.6m (3.6.5) to create virtualenv…
⠋Running virtualenv with interpreter /usr/local/bin/python3.6m
Using base prefix '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/chrisdev/temp/.venv/bin/python3.6
Also creating executable in /Users/chrisdev/temp/.venv/bin/python
Installing setuptools, pip, wheel...done.
Virtualenv location: /Users/chrisdev/temp/.venv
Creating a Pipfile for this project…
temp » pipenv shell
Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.
temp » python --version
Python 2.7.10
temp » python3 --version
Python 3.6.5
temp » pipenv --py
/Users/chrisdev/temp/.venv/bin/python
temp » which python3
/usr/local/bin/python3
temp » which python
/usr/bin/python
temp » echo $PATH
/usr/local/opt/sqlite/bin:.:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin
temp » which pip
/usr/local/bin/pip
temp » echo $VIRTUAL_ENV
/Users/chrisdev/temp/.venv
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (8 by maintainers)
@techalchemy I can only imagine how much you have to go through supporting this tool.
Going through this experience, I now “get it”… or so I think… It now makes sense why I was having that issue, but I would never had guessed (nor realized from reading other issues) that I would need homebrew’s python central to my workflow.
Thanks for all your help!!
For anyone reading this far, to resolve my own issue, I removed the brew-installed pipenv and
pip install pipenv
on my system python (which is actually homebrew’spython@2
). Now it works like a charm.