Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.1k views
in Technique[技术] by (71.8m points)

homebrew - How to correctly activate pipenv shell in zsh?

I'm currently working on a simple Python script and using pipenv to manage dependencies.

Here's the problem:

When running pipenv shell and then python script.py, I'm getting module not found errors for things that are definitely in Pipfile (e.g. requests).

Here's what's interesting: I don't get these problems when I use pipenv run python script.py and I don't get these problems when I use bash instead of zsh, i.e. when I do:

bash
pipenv shell 
python script.py

the script runs happily and resolves the imports. I tried re-installing pipenv using Homebrew, but zsh still doesn't correctly activate my pipenv environment. Any ideas on how to get pipenv to work with zsh or why this would even be problematic?

Using zsh:

zsh

Using bash:

bash


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...