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

Specify python version with py launcher using the mkproject command #120

Open
Ricyteach opened this issue Oct 14, 2021 · 2 comments
Open
Labels

Comments

@Ricyteach
Copy link

Ricyteach commented Oct 14, 2021

First off: sorry to have submitted this as an issue before I had fully investigated, and editing it several times.

I have installed both 3.9 and 3.10 on Windows with virtualenvwrapper-win (which I love using).

When I try to do mkproject using python 3.10, my expectation is for the -p3.10 flag to send the python request to py launcher. But instead, we get some error messages, and the project creation succeeds using the wrong python (3.9).

C:\Users\Rick Teachey>mkproject testagain -p3.10
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
created virtual environment CPython3.9.6.final.0-64 in 1279ms
  creator CPython3Windows(dest=C:\Users\Rick Teachey\Envs\testagain, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\Rick Teachey\AppData\Local\pypa\virtualenv)
    added seed packages: pip==21.2.4, setuptools==58.0.4, wheel==0.37.0
  activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator

    "C:\Users\Rick Teachey\projects\testagain" is now the project directory for
    virtualenv "C:\Users\Rick Teachey\Envs\testagain"
Access is denied.

    "C:\Users\Rick Teachey\projects\testagain" added to
    C:\Users\Rick Teachey\Envs\testagain\Lib\site-packages\virtualenv_path_extensions.pth

(testagain) C:\Users\Rick Teachey\projects\testagain>python -V
Python 3.9.6

When doing the same thing using mkvirtualenv, everything works fine:

C:\Users\Rick Teachey\projects>mkvirtualenv -p3.10 test
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
created virtual environment CPython3.10.0.final.0-64 in 1189ms
  creator CPython3Windows(dest=C:\Users\Rick Teachey\Envs\test, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\Rick Teachey\AppData\Local\pypa\virtualenv)
    added seed packages: pip==21.2.2, setuptools==57.4.0, wheel==0.36.2
  activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator

(test) C:\Users\Rick Teachey\projects>python -V
Python 3.10.0

Shouldn't we be able to do a mkproject -p3.10 my_project and have it send the python version request to py launcher? Is this an issue to be raised with virtualenvwrapper, or something specific to the windows version?

EDIT: this appears to just be how the mkproject command works:

C:\Users\Rick Teachey\projects>mkproject test --python "C:\Users\Rick Teachey\AppData\Local\Programs\Python\Python310\python.exe"
<SNIP>
(test) C:\Users\Rick Teachey\projects\test>python -V
Python 3.9.6

I'll take it up with virtualenvwrapper. Sorry to waste your time.

@Ricyteach Ricyteach changed the title Cryptic error messages when using py launcher Cryptic error messages when trying to use py launcher Oct 14, 2021
@Ricyteach Ricyteach changed the title Cryptic error messages when trying to use py launcher Specify python version with py launcher using the mkproject command Oct 14, 2021
@thebjorn
Copy link
Collaborator

mkproject should probably forward flags it doesn't handle to mkvirtualenv (which it calls). I think this is a bug.

@thebjorn thebjorn reopened this Oct 15, 2021
@thebjorn thebjorn added the bug label Oct 15, 2021
@Ricyteach
Copy link
Author

Ricyteach commented Oct 15, 2021

mkproject should probably forward flags it doesn't handle to mkvirtualenv (which it calls). I think this is a bug.

I'm glad I found it; after I closed this yesterday, and reading up a little bit more on what mkproject is supposed to do, I started to think that it might actually be a bug. But to be honest I was kind of embarrassed about having opened it, changing the title 3 times, deleting a bunch of irrelevant follow-up comments, and closing it.

Anyway, I agree it seems like a bug. Thanks!

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

2 participants