pyenv / pyenv-virtualenv

a pyenv plugin to manage virtualenv (a.k.a. python-virtualenv)
MIT License
6.37k stars 403 forks source link

commit 6179ac76c412d2e9a637b5ea8e7a7e47e4a48363 causes pyenv-virtualenv commands to fail with `pyenv: no installed versions match the prefix `-f'` #488

Closed biblicabeebli closed 2 months ago

biblicabeebli commented 4 months ago

Too many issues will kill our team's development velocity, drastically. Make sure you have checked all steps below.

Prerequisite

I have confirmed all of the above.

Description

This diff includes the probable culprit:

$ git diff cf45718a1b0e86d7a53c8d03d11151306a080ec7 6179ac76c412d2e9a637b5ea8e7a7e47e4a48363 bin/pyenv-virtualenv
*** cutting out the rest of the diff ***

 if [[ -n "${VERSION_NAME}" ]] && command -v pyenv-latest >/dev/null; then
-  VERSION_NAME="$(pyenv-latest -q "${VERSION_NAME}" || echo "${VERSION_NAME}")"
+  VERSION_NAME="$(pyenv-latest -f "${VERSION_NAME}")"
 fi

To reproduce (I've cut out git warnings):

(global):~…/plugins/pyenv-virtualenv (master)$ git checkout 6179ac76c412d2e9a637b5ea8e7a7e47e4a48363
(global):~…/plugins/pyenv-virtualenv ((HEAD detached at 6179ac7))$ pyenv virtualenv 3.12.1 evdev8
pyenv: no installed versions match the prefix `-f'

# environment not created

(global):~…/plugins/pyenv-virtualenv ((HEAD detached at 6179ac7))$ git checkout cf45718a1b0e86d7a53c8d03d11151306a080ec7
(global):~…/plugins/pyenv-virtualenv ((HEAD detached at cf45718))$ pyenv virtualenv 3.12.1 evdev8

# environment created

(my shell prompt says what the current branch of the repo is)

gianlucapm commented 4 months ago

got the same problem on Manjaro:

Here it's the PYENV_DEBUG output: log.txt

native-api commented 4 months ago

Please upgrade Pyenv to 2.4.8

gianlucapm commented 4 months ago

Please upgrade Pyenv to 2.4.8

Upgrading from 2.4.7 to 2.4.8 solved the issue, thanks for the support

biblicabeebli commented 4 months ago

I was in a situation where pyenv itself, via the pyenv update command, would pull its git updates and update successfully... to version 2.3.34.

Baffling.

I went ahead and reinstalled pyenv and now it's all worky again.

Y'all can close.

zhuweiji commented 3 months ago

Same here, pyenv update updates to version 2.3.23

kyungjunleeme commented 2 months ago
image

I'm suffer from this issue. ㅜ ㅅ ㅜ. but, It's working ㅜ

image
wizpig64 commented 2 months ago

today this was my personal cloudstrike.

I was in a situation where pyenv itself, via the pyenv update command, would pull its git updates and update successfully... to version 2.3.34.

this was me! for a while i was in a state where...

Updating /home/agrimgt/.pyenv...
From https://github.com/pyenv/pyenv
 * branch              master     -> FETCH_HEAD
 ! [rejected]          v2.3.35    -> v2.3.35  (would clobber existing tag)```

was showing in my automated script but i didn't realize that it wasnt updating the rest of the tags and ignored it, until the error in the title of this post reared its head. had to manually go in with $ git -C .pyenv fetch --tags --force to unstick the tag, and pyenv updated smoothly again.

biblicabeebli commented 2 months ago

"this was my personal cloudstrike." 🤌 lmao