Skip to content
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

Are the python3.1 symlinks still needed for Python 3.11? #611

Open
jtilly opened this issue Dec 12, 2022 · 5 comments
Open

Are the python3.1 symlinks still needed for Python 3.11? #611

jtilly opened this issue Dec 12, 2022 · 5 comments
Labels

Comments

@jtilly
Copy link

jtilly commented Dec 12, 2022

Comment:

I noticed that for Python 3.11, we're still creating python3.1 symlinks (that were introduced for Python 3.10):

ln -s ${PREFIX}/bin/python3.11 ${PREFIX}/bin/python3.1

ln -s "${PREFIX}/lib/python3.11" "${PREFIX}/lib/python3.1"

Are these (still) needed?

@vvzen
Copy link

vvzen commented Jan 25, 2024

Bumping this up since we're run into this recently while creating a conda pack env for python3.10 and it seems like a bug. Is this something that the previous PR missed, or is it intentional ?

@isuruf
Copy link
Member

isuruf commented Jan 25, 2024

These symlinks are needed to support noarch packages with older conda. What's the issue with the symlink?

@vvzen
Copy link

vvzen commented Jan 25, 2024

Thanks for replying back! No particular issue, I bumped on this quirk using some internal tooling I can't share, but tied to the detection of the site-packages directory.

A repro could be:

$ conda create -n some-env python==3.10
$ conda activate some-env
$ conda install conda-pack==0.7.1

$ mkdir /tmp/conda-pack-symlink-issue && cd /tmp/conda-pack-symlink-issue
$ conda pack --name some-env
$ tar -xvf some-env.tar.gz

$ python3 -c "import glob, os, pprint; pprint.pprint(glob.glob(f'{os.getcwd()}/lib/python3*/site-packages'))"
['/tmp/conda-pack-symlink-issue/lib/python3.1/site-packages',
 '/tmp/conda-pack-symlink-issue/lib/python3.10/site-packages']

# If you repeat the same steps but ask for python==3.9 things look as expected:
$ python3 -c "import glob, os, pprint; pprint.pprint(glob.glob(f'{os.getcwd()}/lib/python3*/site-packages'))"
['/tmp/conda-pack-symlink-issue/lib/python3.9/site-packages']

Unless you know all of the history (documented in the relevant issues here and there on the conda/conda pack github), seeing a 3.1 pop in there can create confusion.

Of course, this is not a big deal at all and a workaround is a one line change - I was just curious if this backward compatibility "hack" is gonna disappear at some point, maybe in a major release of conda-pack ?

Thanks again!
V

@isuruf
Copy link
Member

isuruf commented Jan 25, 2024

I was just curious if this backward compatibility "hack" is gonna disappear at some point, maybe in a major release of conda-pack ?

Not sure when it's going to be.

@ytausch
Copy link

ytausch commented Jun 11, 2024

The python3.1 symlinks break the Python extension of VSCode because it detects the Python version based on the interpreter file names: microsoft/vscode-python#22877

This is the relevant source code: getPythonVersionFromNearByFiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants