MichaelAquilina / zsh-autoswitch-virtualenv

🐍 ZSH plugin to automatically switch python virtualenvs (including pipenv and poetry) as you move between directories
GNU General Public License v3.0
507 stars 80 forks source link

Creates venv with mkvenv but doesn't autoswitch #164

Open erikc96 opened 2 years ago

erikc96 commented 2 years ago

Issue Details

Please provide the following details when opening an issue:

Operating System (uname -a)

Darwin Eriks-MacBook-Pro-1037.local 21.1.0 Darwin Kernel Version 21.1.0: Sat Sep 11 12:27:45 PDT 2021; root:xnu-8019.40.67.171.4~1/RELEASE_ARM64_T8101 arm64

zsh version (zsh --version)

zsh 5.8 (x86_64-apple-darwin21.0)

autoswitch-virtualenv version

echo "$AUTOSWITCH_VERSION"
3.3.2

How is zsh-autoswitch-virtualenv installed?

zplug

Steps to reproduce the issue

I run mkvenv, and it executes succesfully. The venv is activated.

craigoej@Eriks-MacBook-Pro-1037 Project % mkvenv
Installing dependencies from Pipfile.lock (c71240)...
  🐍   β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰ 0/0 β€” 00:00:00
Switching pipenv: Project [🐍Python 3.9.7]
(Project) craigoej@Eriks-MacBook-Pro-1037 Project %

But if I leave the project and come back, I get this:

Python pipenv project detected. Run mkvenv to setup autoswitching

gist link to your zshrc


source ~/.zplug/init.zsh

# Make sure to use double quotes
zplug "zsh-users/zsh-history-substring-search"
zplug "MichaelAquilina/zsh-autoswitch-virtualenv"

# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
    printf "Install? [y/N]: "
    if read -q; then
        echo; zplug install
    fi
fi

# Then, source plugins and add commands to $PATH
zplug load --verbose
MichaelAquilina commented 2 years ago

What does PIPENV_IGNORE_VIRTUALENVS=1 pipenv --venv 2>/dev/null return when you run it in the folder you expect to auto activate?

erikc96 commented 2 years ago

It returns this!

/Users/craigoej/.local/share/virtualenvs/PROJECT-DbCaeqs2

On Thu, Oct 14, 2021 at 6:19 AM Michael Aquilina @.***> wrote:

What does PIPENV_IGNORE_VIRTUALENVS=1 pipenv --venv 2>/dev/null return when you run it in the folder you expect to auto activate?

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MichaelAquilina/zsh-autoswitch-virtualenv/issues/164#issuecomment-943219677, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVNEVBIGMJ6IHP6TOKWJNLUG2VCPANCNFSM5F6PFOYQ .