-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python module failing to run pyenv virtualenv-init #1428
Comments
Additionally, if one installs I think the first if-check condition should be changed to
|
Doing some more diving, and it seems like there is a |
@zachwhaley How did you install pyenv-virtualenv? |
@gpanders I believe I installed it using pyenv-installer |
@zachwhaley I removed my last comment. I just looked through the
So if the |
@gpanders Good question. I'll look into this and get back to y'all. |
So running
So I do think your original comment was correct. Prezto can't rely on the plugin executables being in the user's PATH. SO link 🙂 |
If we can't rely on pyenv being in the path, how can we find it? virtualenvwrapper is reasonable because it has a few possible names it can be called (some of which are in the PATH and some which aren't)... but people don't generally install it to some random location. Are there common locations the pyenv commands are installed which we could check (allowing an override for completely different paths)? I personally don't currently use pyenv... I stick to just virtualenvwrapper... but I would be happy to review any pull requests which attempt to solve this. |
@belak The command |
@zachwhaley did you experienced this problem with pyenv virtualenvwrapper? or something similar to it? |
If you want to avoid calling a command that doesn't exist, you could use the e.g. if pyenv commands | command grep -q virtualenv-init; then
$(pyenv virtualenv-init -)
fi |
@diraol I don't have virtualenvwrapper installed, which is why the fallback in python/init.zsh doesn't work for me. |
@zachwhaley That looks like it should work to me. Do you want to test it and write a PR? |
@gpanders Sure! |
Okay, catching up on this one. Apologies for delayed response.
Based on source, it seems to be doing regular But seems like this worked for @gpanders, so I am wondering how this is getting treated different from Edit: Is it possible that |
@indrajitr The reason it worked for me is because I was on a Mac and installed the However, when installing Edit: There does seem to be some confusion here regarding the difference between |
Description
It seems like the Python module is incorrectly using the
commands
array, by trying to find a command namedpyenv-virtualenv-init
, causing the module to not find and runpyenv virtualenv-init
.Line in question: https://github.com/sorin-ionescu/prezto/blob/master/modules/python/init.zsh#L96
But looking at the code history, the Python module has been using this since April of 2017 1050a0a, so I feel like I must be doing something wrong.
I have pyenv installed with the virtualenv plugin, but when I run
$+commands[pyenv-virtualenv-init]
in my shell I get0
Expected behavior
virtualenv is loaded via pyenv
Actual behavior
virtualenv is not loaded, and an error is printed on shell open
Steps to Reproduce
zstyle ':prezto:module:python:virtualenv' auto-switch 'yes'
Versions
The text was updated successfully, but these errors were encountered: