You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot seem to specify a specific virtualenv. I have many virtualenv's managed with pyenv so I cannot test the --all option to see if it is an issue with something in my global environment.
OS: macOS Big Sur 10.16
Shell: zsh
pyenv version: 2.0.6
Errors:
$ pyenv pip-upgrade 3.9.0/envs/siemens_po-fastapi-nano
/Users/red_rocket/.pyenv/plugins/pyenv-pip-upgrade/bin/pyenv-pip-upgrade: line 107: pyenvs_to_update[@]: unbound variable
Worth noting calling the command with no arguments returns a similar error:
$ pyenv pip-upgrade
/Users/red_rocket/.pyenv/plugins/pyenv-pip-upgrade/bin/pyenv-pip-upgrade: line 80: $1: unbound variable
Also see number 5 below using full path as arg instead, outputs different error
Reproducing:
Ensuring plugin installed successfully by checking if --help arg
$ pyenv pip-upgrade --help
Usage: pyenv pip-upgrade [OPTIONS] <pyenv_env1> [<pyenv_env2> ...]
pyenv pip-upgrade [OPTIONS] --all
This command update all packages to the latest versions of particular or all
pyenv environments excluding system. By default, pip-upgrade update all
outdated packages of an environment at once. New pip versions will generate an
error if the environment contains packages with conflicting dependencies. In
this case, you can add option '--sequential' to update packages sequentially,
however, the lately updated package will have precedence in this case
overriding the dependencies of the packages updated before.
ARGUMENTS:
--all - to update all environments
OPTIONS:
--sequential - update all outdated packages one by one
Attempting tab completion (seems treat each env as an entire block, perhaps related to zsh)
Attempting to run on single environment as per README example:
$ pyenv pip-upgrade 3.9.0/envs/siemens_po-fastapi-nano
/Users/red_rocket/.pyenv/plugins/pyenv-pip-upgrade/bin/pyenv-pip-upgrade: line 107: pyenvs_to_update[@]: unbound variable
Attempting to use the full path to the env as input arg returns same error
$ pyenv pip-upgrade /Users/red_rocket/.pyenv/versions/3.9.0/envs/siemens_po-fastapi-nano
[ERROR]: Invalid arguments detected: /Users/red_rocket/.pyenv/versions/3.9.0/envs/siemens_po-fastapi-nano
Usage: pyenv pip-upgrade [OPTIONS] <pyenv_env1> [<pyenv_env2> ...]
pyenv pip-upgrade [OPTIONS] --all
This command update all packages to the latest versions of particular or all
pyenv environments excluding system. By default, pip-upgrade update all
outdated packages of an environment at once. New pip versions will generate an
error if the environment contains packages with conflicting dependencies. In
this case, you can add option '--sequential' to update packages sequentially,
however, the lately updated package will have precedence in this case
overriding the dependencies of the packages updated before.
ARGUMENTS:
--all - to update all environments
OPTIONS:
--sequential - update all outdated packages one by one
Again, this plugin looks incredible, and would love to help contribute if this is some sort of environment-specific issue (zsh, osx, etc.)
EDIT: Also from your blog post I have used pyenv versions --bare --skip-aliases and attempted to use that output as an arg, same error.
The text was updated successfully, but these errors were encountered:
limsammy
changed the title
[POTENTIAL BUG] Cannot update specific virtualenv, and tab completion is producing unexpected results
[POTENTIAL BUG] Cannot update specific virtualenv, tab completion is producing unexpected results
Sep 11, 2021
@limsammy First of all, thank you for your kind words and the submitted issue!
Actually, I had a pretty outdated version of pyenv on my machine. I have updated it to the latest (2.0.6-7) and checked if I can reproduce the issue. Unfortunately, on my machine everything still works fine.
However, I've tried to investigate what can be the problem in your case. First of all, it seems that virtualenv plugin is not working correctly for some setups after upgrading to pyenv v2 (pyenv corresponding issue and pyenv-virtualenv issue). Try to use the workarounds provided in these issues.
Also, could you please check if the command pyenv versions (without additional flags) work fine on your setup?
I also ran into this issue - escaping the expansion of the list on line 107 did the trick for me, I'm unsure if there should be other escapes on the other quoted expansions so replying here instead of submitting a PR, leaving that up to you @zyrikby - fantastic work!
original: if ! elementIn "${argument}" "${pyenvs_to_update[@]}"; then
escaped: if ! elementIn "${argument}" "\${pyenvs_to_update[@]}"; then
First of all, this is an awesome plugin.
To the issue:
I cannot seem to specify a specific virtualenv. I have many virtualenv's managed with pyenv so I cannot test the
--all
option to see if it is an issue with something in my global environment.Errors:
Worth noting calling the command with no arguments returns a similar error:
$ pyenv pip-upgrade /Users/red_rocket/.pyenv/plugins/pyenv-pip-upgrade/bin/pyenv-pip-upgrade: line 80: $1: unbound variable
Also see number 5 below using full path as arg instead, outputs different error
Reproducing:
--help
argAgain, this plugin looks incredible, and would love to help contribute if this is some sort of environment-specific issue (zsh, osx, etc.)
EDIT: Also from your blog post I have used
pyenv versions --bare --skip-aliases
and attempted to use that output as an arg, same error.The text was updated successfully, but these errors were encountered: