Open avoidik opened 1 month ago
Please provide a debug log showcasing the problem (i.e. the link's creation) as per the issue template.
That line is supposed to create a link $PYENV_ROOT/versions/<env_name> -> $PYENV_ROOT/versions/<python_version>/envs/<env_name>
.
sure, here is the relevant part (line no. 17)
+(/opt/homebrew/Cellar/pyenv/2.4.7/libexec/pyenv-exec:48): exec /Users/user.name/.pyenv/versions/3.10.14/bin/python3.10 -m venv /Users/user.name/.pyenv/versions/3.10.14/envs/venvname
+(/opt/homebrew/bin/pyenv-virtualenv:610): shopt -s nullglob
+(/opt/homebrew/bin/pyenv-virtualenv:611): for extra_binary in "$PREFIX"/bin/python*-config
++(/opt/homebrew/bin/pyenv-virtualenv:612): basename /Users/user.name/.pyenv/versions/3.10.14/bin/python-config
+(/opt/homebrew/bin/pyenv-virtualenv:612): extra_binary_linkname=/Users/user.name/.pyenv/versions/3.10.14/envs/venvname/bin/python-config
+(/opt/homebrew/bin/pyenv-virtualenv:613): [[ -e /Users/user.name/.pyenv/versions/3.10.14/envs/venvname/bin/python-config ]]
+(/opt/homebrew/bin/pyenv-virtualenv:611): for extra_binary in "$PREFIX"/bin/python*-config
++(/opt/homebrew/bin/pyenv-virtualenv:612): basename /Users/user.name/.pyenv/versions/3.10.14/bin/python3-config
+(/opt/homebrew/bin/pyenv-virtualenv:612): extra_binary_linkname=/Users/user.name/.pyenv/versions/3.10.14/envs/venvname/bin/python3-config
+(/opt/homebrew/bin/pyenv-virtualenv:613): [[ -e /Users/user.name/.pyenv/versions/3.10.14/envs/venvname/bin/python3-config ]]
+(/opt/homebrew/bin/pyenv-virtualenv:611): for extra_binary in "$PREFIX"/bin/python*-config
++(/opt/homebrew/bin/pyenv-virtualenv:612): basename /Users/user.name/.pyenv/versions/3.10.14/bin/python3.10-config
+(/opt/homebrew/bin/pyenv-virtualenv:612): extra_binary_linkname=/Users/user.name/.pyenv/versions/3.10.14/envs/venvname/bin/python3.10-config
+(/opt/homebrew/bin/pyenv-virtualenv:613): [[ -e /Users/user.name/.pyenv/versions/3.10.14/envs/venvname/bin/python3.10-config ]]
+(/opt/homebrew/bin/pyenv-virtualenv:619): '[' -d /Users/user.name/.pyenv/versions/3.10.14/envs/venvname ']'
+(/opt/homebrew/bin/pyenv-virtualenv:619): '[' -n /Users/user.name/.pyenv/versions/venvname ']'
+(/opt/homebrew/bin/pyenv-virtualenv:620): ln -fs /Users/user.name/.pyenv/versions/3.10.14/envs/venvname /Users/user.name/.pyenv/versions/venvname
+(/opt/homebrew/bin/pyenv-virtualenv:623): '[' '!' -e /Users/user.name/.pyenv/versions/3.10.14/envs/venvname/bin/pydoc ']'
+(/opt/homebrew/bin/pyenv-virtualenv:634): '[' -z 1 ']'
+(/opt/homebrew/bin/pyenv-virtualenv:646): '[' 0 == 0 ']'
+(/opt/homebrew/bin/pyenv-virtualenv:647): pyenv-rehash
+(/opt/homebrew/Cellar/pyenv/2.4.7/libexec/pyenv-rehash:7): SHIM_PATH=/Users/user.name/.pyenv/shims
just fyi, ln
works a little bit different on macos, it creates not only a symlink at the target, but also at the source, for example:
$ ln -fs /Users/user.name/.pyenv/versions/3.10.14/envs/venvname /Users/user.name/.pyenv/versions/venvname
$ ls -la /Users/user.name/.pyenv/versions/venvname
lrwxr-xr-x@ 1 user.name staff 59 Jul 11 10:10 /Users/user.name/.pyenv/versions/venvname -> /Users/user.name/.pyenv/versions/3.10.14/envs/venvname
$ ls -la /Users/user.name/.pyenv/versions/venvname/venvname
lrwxr-xr-x@ 1 user.name staff 59 Jul 11 10:14 /Users/user.name/.pyenv/versions/venvname/venvname -> /Users/user.name/.pyenv/versions/3.10.14/envs/venvname
versus
$ ln -fsn /Users/user.name/.pyenv/versions/3.10.14/envs/venvname /Users/user.name/.pyenv/versions/venvname
$ ls -la /Users/user.name/.pyenv/versions/venvname
lrwxr-xr-x@ 1 user.name staff 59 Jul 11 10:17 /Users/user.name/.pyenv/versions/venvname -> /Users/user.name/.pyenv/versions/3.10.14/envs/venvname
$ ls -la /Users/user.name/.pyenv/versions/venvname/venvname
ls: /Users/user.name/.pyenv/versions/venvname/venvname: No such file or directory
Too many issues will kill our team's development velocity, drastically. Make sure you have checked all steps below.
Prerequisite
pyenv-virtualenv
plugin only. Please refrain from reporting issues of other plugins here.Description
[x] Please attach the debug log of a faulty Pyenv invocation as a gist
PYENV_DEBUG=1
, e.g.env PYENV_DEBUG=1 pyenv install -v 3.6.4
If the problem happens outside of a Pyenv invocation, get the debug log like this:
Problem description
This line here creates a weird cyclic symlink inside of a virtualenv directory.
For example, this line attempts to create the following symlink:
However the target and the source directory is the same directory:
As a result
If I'd prepend this line with echo, like this
There is no weird cyclic symlink getting created.
Is this something expected or a bug?