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.

Issues running pipenv & pyenv

See original GitHub issue

I am unable do activate virtualenv using pipenv shell with python managed by pyenv.

Here is the output of my terminal:

roger@ohm:/tmp/lab $ pipenv --venv
No virtualenv has been created for this project yet!
roger@ohm:/tmp/lab $ pipenv install requests
Creating a Pipfile for this project...
Creating a virtualenv for this project...
⠋Using base prefix '/home/roger/.pyenv/versions/3.6.1'
New python executable in /home/roger/.local/share/virtualenvs/lab-O8QxVB32/bin/python3.6
Also creating executable in /home/roger/.local/share/virtualenvs/lab-O8QxVB32/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /home/roger/.local/share/virtualenvs/lab-O8QxVB32
Installing requests...
Collecting requests
  Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests)
  Using cached urllib3-1.22-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests)
  Using cached idna-2.6-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests)
  Using cached certifi-2017.7.27.1-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests)
  Using cached chardet-3.0.4-py2.py3-none-any.whl
Installing collected packages: urllib3, idna, certifi, chardet, requests
Successfully installed certifi-2017.7.27.1 chardet-3.0.4 idna-2.6 requests-2.18.4 urllib3-1.22

Adding requests to Pipfile's [packages]...
P.S. You have excellent taste! ✨ 🍰 ✨
roger@ohm:/tmp/lab $ pipenv shell
ERROR: The virtualenv hasn't been activated correctly.
Either the env is corrupted (try running `pew restore env`),
Or an upgrade of your Python version broke your env,
Or check the contents of your $PATH. You might be adding new directories to it
from inside your shell's configuration file.
In this case, for further details please see: https://github.com/berdario/pew#the-environment-doesnt-seem-to-be-activated

I followed the steps of the URL above, changing PATH order, but no sucess.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:30 (19 by maintainers)

github_iconTop GitHub Comments

21reactions
jacebrowningcommented, Sep 2, 2017

pyenv does some weird things, and isn’t recommended.

What weird things are you referring to? I’ve used pyenv for years and have never had problems with pip, virtualenv, or any other packages I’ve installed.

How else do people manage the installation and selection of multiple Python versions? I think the usage of pyenv is more common than you let on. 😄

2reactions
uranusjrcommented, Mar 8, 2018

Just install Pipenv anywhere (as long as you can run it), and yes, it would just work. You don’t even need to add the shim directory to PATH or pyenv global anything (basically you don’t need the shims). All you need to set is the PYENV_ROOT environment variable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Encountered Pipenv Problems - Read the Docs
This is usually a result of mixing Pipenv with system packages. We strongly recommend installing Pipenv in an isolated environment. Uninstall all existing ......
Read more >
How to Manage your Python Projects with Pipenv and Pyenv
A Python virtual environment is an important tool for developers to separate project dependencies in isolated environments.
Read more >
Why is Pipenv not picking up my Pyenv versions?
You can try this to make Pipenv follow the Pyenv Python version: Direct Pipenv to the Pyenv shim in your shell config file...
Read more >
PyEnv && Pipenv - Medium
Pyenv sort of hijacks the pip command, to make sure you're working in the correct environment. After this you're ready to start using...
Read more >
Python Environment 101 - Towards Data Science
In this article, I am focusing on pyenv and pipenv since virtualenv alone will have a problem when you update your system Python...
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