Closed MichaelAquilina closed 8 months ago
@seakayone would you mind checking if this branch works for you?
I have checked it out and it is working for me, Resolves #175
Last login: Tue Mar 29 19:25:52 on ttys001
❯ cd /tmp/foo autoswitch_virtualenv/git/fix/175
Switching virtualenv: foo-ktrt [Python 3.8.12]
(foo-ktrt) /tmp/foo❯ rmvenv
Deactivating: foo-ktrt
Removing foo-ktrt...
/tmp/foo❯ mkvenv
Creating foo-lsgt virtualenv
created virtual environment CPython3.8.12.final.0-64 in 207ms
creator CPython3Posix(dest=/Users/kleinboelting/.virtualenvs/foo-lsgt, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/kleinboelting/Library/Application Support/virtualenv)
added seed packages: pip==22.0.4, setuptools==60.9.3, wheel==0.37.1
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
Switching virtualenv: foo-lsgt [Python 3.8.12]
(foo-lsgt) /tmp/foo❯
~/.oh-my-zsh/custom/plugins on master ⌚ 10:46:08
$ cd autoswitch_virtualenv
WARNING: python binary not found on PATH.
zsh-autoswitch-virtualenv plugin will be disabled.
~/.oh-my-zsh/custom/plugins/autoswitch_virtualenv on 1070d49 ⌚ 10:46:09
Doesn't work with the branch either. I don't even have python (2.x) installed. I only have a python3. Running latest ubuntu.
-> when I press enter I get the WARNING.
I'm testing it and it works too.
Seems I forgot about this but should still work :) merged
@MichaelAquilina this if statement https://github.com/MichaelAquilina/zsh-autoswitch-virtualenv/blob/4ddc42d3d84bfb36fac1eb48e9e6de33a92fa4f1/autoswitch_virtualenv.plugin.zsh#L416
should also check for AUTOSWITCH_DEFAULT_PYTHON
env variable, not just python, otherwise breaks setups like mine, where I don't have an alias for python
and makes the whole point of AUTOSWITCH_DEFAULT_PYTHON
useless
This allows plugins like pyenv that load python in PATH later to work correctly
Fixes #175
Tests need to be updated but opening this up early to check if this fixes the original Issue author's problem