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

Utilize py launcher on windows for pdm use and pdm venv #2225

Closed
p-rogalski opened this issue Sep 1, 2023 · 4 comments · Fixed by j178/pdm#1
Closed

Utilize py launcher on windows for pdm use and pdm venv #2225

p-rogalski opened this issue Sep 1, 2023 · 4 comments · Fixed by j178/pdm#1
Labels
⭐ enhancement Improvements for existing features

Comments

@p-rogalski
Copy link
Contributor

p-rogalski commented Sep 1, 2023

Is your feature request related to a problem? Please describe.

Python interpreters can be specified for the commands pdm use and pdm venv. However the full path to the Python interpreter must be given.

Alternatively all the Python interpreters can be added to PATH, which creates a big mess on Windows, since all Python executables are named the same. This mess is solved by the py launcher on Windows: https://docs.python.org/3/using/windows.html#python-launcher-for-windows

Describe the solution you'd like

It would be really helpful if PDM could utilize the py launcher to find Python executables. Specifically if you could specify the same version selectors like for the py launcher. Some examples:

pdm use "3.10"                   # Use Python 3.10
pdm use "3.11-32"                # Use Python 3.11 (32 bit)
pdm venv create "3.9-64"         # Create venv with Python 3.9 (64 bit)
pdm venv create "3"              # Create venv with Python 3

References

@p-rogalski p-rogalski added the ⭐ enhancement Improvements for existing features label Sep 1, 2023
@frostming
Copy link
Collaborator

The python finder nows reads from the same source as py so what is not working for now?

@p-rogalski
Copy link
Contributor Author

Ah my mistake, pdm use 3.10 and the like actually works. However, I found no way to specify the architecture (32/64 bit):

> pdm use 3.10  
Please enter the Python interpreter to use
0. C:\Users\p.rogalski\AppData\Local\Programs\Python\Python310-32\python.exe (3.10-32)
1. C:\Users\p.rogalski\AppData\Local\Programs\Python\Python310\python.exe (3.10)
> pdm use 3.10-32
[NoPythonVersion]: No Python interpreter matching 3.10-32 is found.

@frostming
Copy link
Collaborator

No you can't, just choose from the listed interpreters and I think it's just easy enough.

@p-rogalski
Copy link
Contributor Author

Ok fair enough, thank you for your time!

frostming added a commit that referenced this issue Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement Improvements for existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants