dikoobraz
dikoobraz

Reputation: 61

pipenv shell, does not activate the virtual environment

I'm trying to go to work with pipenv, but I have problems with the launch of the virtual environment.

errors:

➜  test_pipenv pipenv shell
Launching subshell in virtual environment…
 . /home/user/.local/share/virtualenvs/test_pipenv-mzRyHdZF/bin/activate
➜  test_pipenv  . /home/user/.local/share/virtualenvs/test_pipenv-mzRyHdZF/bin/activate
cd: **This is not a directory:** /home/user/.local/share/virtualenvs/test_pipenv-mzRyHdZF/bin/activate

or

➜  test_pipenv /home/user/.local/share/virtualenvs/venv-mzRyHdZF/bin/activate
zsh: **Access denied:** /home/user/.local/share/virtualenvs/venv-mzRyHdZF/bin/activate

or

➜  test_pipenv source /home/user/.local/share/virtualenvs/venv-mzRyHdZF/bin/activate
(test_pipenv) ➜  test_pipenv pip freeze  
certifi==2018.10.15
chardet==3.0.4
idna==2.7
requests==2.19.1
urllib3==1.23

I installed the pipenv twice and get the same error:

sudo pip install pipenv

and

pip install --user pipenv

I get the same error I use arch linux and zsh

.zshrc 
export PATH=/usr/local/bin:$PATH
export SHELL=/bin/zsh
PIPENV_SHELL=/use/bin/zsh
export ZSH=/home/user/.oh-my-zsh
export PATH="$HOME/.local/bin:$PATH"

Help me please. Why does not it work pipenv shell?

Upvotes: 5

Views: 18653

Answers (5)

Alvin
Alvin

Reputation: 1

Create Pipenv environment:

  1. change to cmd terminal
  2. type: pip install pipenv
  3. type: python -m pipenv shell

Upvotes: 0

Shubham
Shubham

Reputation: 45

If you are In Arch Linux switch bash to fish.

Then run :

pipenv shell

Upvotes: 0

user17549243
user17549243

Reputation: 1

check for permissions on your $HOME/.local/share/virtualenvs directory. If you are not allowed to create files/ directories in there, you cannot start a virtual env.

Upvotes: 0

George
George

Reputation: 21

Try doing this:

pip uninstall pipenv

this will uninstall existing pipenv after doing that re-install pipenv by doing this:

pip install pipenv

Upvotes: 2

Dominique Paul
Dominique Paul

Reputation: 1759

(can't comment so I'll add this as an answer)

Hi,

From what I can tell you are doing all of this in terminal. If you do not have to work with pipenv, then I would recommend using virtualenv.

Install:

pip install virtualenv

Create a new virtual env:

virtualenv -p python3 your_env_name

load virtual env (from path where created file is located in):

source your_env_name/bin/activate

You can save your packages already installed with pip like this:

pip freeze > requirements.txt

and then load them in your virtual env (once you have loaded it) like this:

pip install -r requirements.txt

Hope this helps! :)

Upvotes: -6

Related Questions