• Re: Python not showing correct version

    From Sumeet Firodia@21:1/5 to All on Thu Mar 30 19:47:25 2023

    Hi Team,

    I have installed Python 3.8 for Snowpark but when I check the version in command prompt it shows me Python 3.10.10.

    C:\Users\admin>python --version
    Python 3.10.10

    Also when I try to uninstall 3.10 it says no such version is installed.

    C:\Users\admin>pip uninstall python 3.10.10
    WARNING: Skipping python as it is not installed.
    WARNING: Skipping 3.10.10 as it is not installed.

    Can you please help me here as my snowpark assignment is stuck because of this issue.

    Thanks
    Sumeet



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Barry Scott@21:1/5 to All on Thu Mar 30 18:14:51 2023
    On 30 Mar 2023, at 15:17, Sumeet Firodia <ssfirodia@gmail.com> wrote:


    Hi Team,

    I have installed Python 3.8 for Snowpark but when I check the version in
    command prompt it shows me Python 3.10.10.

    C:\Users\admin>python --version
    Python 3.10.10

    Try this:

    py -3.8

    And this to list all version of python installed:

    py -0



    Also when I try to uninstall 3.10 it says no such version is installed.

    C:\Users\admin>pip uninstall python 3.10.10
    WARNING: Skipping python as it is not installed.
    WARNING: Skipping 3.10.10 as it is not installed.

    PIP is for installing python modules not the python program.
    The python program is installed by running the .exe that you get from python.org <http://python.org/>, for example.
    Use the standard Windows method to uninstall a program.
    Search the web for "windows uninstall software" if you are not sure how to do this.

    Barry


    Can you please help me here as my snowpark assignment is stuck because of
    this issue.

    Thanks
    Sumeet


    --
    https://mail.python.org/mailman/listinfo/python-list


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Passin@21:1/5 to Sumeet Firodia on Thu Mar 30 13:23:34 2023
    On 3/30/2023 10:17 AM, Sumeet Firodia wrote:

    Hi Team,

    I have installed Python 3.8 for Snowpark but when I check the version in
    command prompt it shows me Python 3.10.10.

    C:\Users\admin>python --version
    Python 3.10.10

    Also when I try to uninstall 3.10 it says no such version is installed.

    C:\Users\admin>pip uninstall python 3.10.10
    WARNING: Skipping python as it is not installed.
    WARNING: Skipping 3.10.10 as it is not installed.

    Can you please help me here as my snowpark assignment is stuck because of
    this issue.

    You cannot uninstall Python using pip. It was not installed using it.

    You probably should not uninstall Python 3.10.10. There are two
    possibilities:

    1. The Snowpack programs will work with Python 3.10. Just run them with "python". This is likely. I notice that its location is unusual, and I
    wonder how and why it got installed there.

    2. For some reason, you have to use the Python 3.8 installation. Either
    find out where it is located on your system, and create a batch file to
    run it - you could name it "py38" and type "py38" instead of "python".
    Or you may be able to use the "py" launcher. It will be there if Python
    was installed using the ordinary Python installer from python.org. You
    would type "py -38" instead of "python".

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From moi@21:1/5 to All on Thu Mar 30 23:52:46 2023
    py.exe : a false good idea.

    PS C:\humour> py38.bat
    Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:34:34) [MSC v.1928 32 bit (Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    ^Z

    PS C:\humour> p38.ps1 -c "print('999')"
    999

    PS C:\humour> py310.bat --version
    Python 3.10.9

    PS C:\humour> p310.ps1
    Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    ^Z

    PS C:\humour> py311 -c "print('embeded version')"
    embeded version

    PS C:\humour>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Barry Scott@21:1/5 to All on Fri Mar 31 09:48:55 2023
    On 31 Mar 2023, at 09:33, Sumeet Firodia <ssfirodia@gmail.com> wrote:

    Thanks Barry.

    One more thing is that pip --version also refers to python 3.10

    C:\Users\admin>pip --version
    pip 23.0.1 from C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip (python 3.10)

    Use this command to ensure that pip matches the python you wish to use:

    py -3.8 -m pip --version

    Barry


    The issue here is I am trying to use snowpark for which I need python 3.8 but because of this I am not able to proceed with next steps.

    Thanks
    Sumeet

    On Thu, 30 Mar 2023 at 22:45, Barry Scott <barry@barrys-emacs.org <mailto:barry@barrys-emacs.org>> wrote:


    On 30 Mar 2023, at 15:17, Sumeet Firodia <ssfirodia@gmail.com <mailto:ssfirodia@gmail.com>> wrote:


    Hi Team,

    I have installed Python 3.8 for Snowpark but when I check the version in >>>> command prompt it shows me Python 3.10.10.

    C:\Users\admin>python --version
    Python 3.10.10

    Try this:

    py -3.8

    And this to list all version of python installed:

    py -0



    Also when I try to uninstall 3.10 it says no such version is installed. >>>>
    C:\Users\admin>pip uninstall python 3.10.10
    WARNING: Skipping python as it is not installed.
    WARNING: Skipping 3.10.10 as it is not installed.

    PIP is for installing python modules not the python program.
    The python program is installed by running the .exe that you get from python.org <http://python.org/>, for example.
    Use the standard Windows method to uninstall a program.
    Search the web for "windows uninstall software" if you are not sure how to do this.

    Barry


    Can you please help me here as my snowpark assignment is stuck because of >>>> this issue.

    Thanks
    Sumeet


    --
    https://mail.python.org/mailman/listinfo/python-list

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sumeet Firodia@21:1/5 to Barry Scott on Fri Mar 31 14:03:49 2023
    Thanks Barry.

    One more thing is that pip --version also refers to python 3.10

    C:\Users\admin>pip --version
    pip 23.0.1 from C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip
    (python 3.10)

    The issue here is I am trying to use snowpark for which I need python 3.8
    but because of this I am not able to proceed with next steps.

    Thanks
    Sumeet

    On Thu, 30 Mar 2023 at 22:45, Barry Scott <barry@barrys-emacs.org> wrote:



    On 30 Mar 2023, at 15:17, Sumeet Firodia <ssfirodia@gmail.com> wrote:


    Hi Team,

    I have installed Python 3.8 for Snowpark but when I check the version in command prompt it shows me Python 3.10.10.

    C:\Users\admin>python --version
    Python 3.10.10


    Try this:

    py -3.8

    And this to list all version of python installed:

    py -0



    Also when I try to uninstall 3.10 it says no such version is installed.

    C:\Users\admin>pip uninstall python 3.10.10
    WARNING: Skipping python as it is not installed.
    WARNING: Skipping 3.10.10 as it is not installed.


    PIP is for installing python modules not the python program.
    The python program is installed by running the .exe that you get from python.org, for example.
    Use the standard Windows method to uninstall a program.
    Search the web for "windows uninstall software" if you are not sure how to
    do this.

    Barry


    Can you please help me here as my snowpark assignment is stuck because of this issue.

    Thanks
    Sumeet


    --
    https://mail.python.org/mailman/listinfo/python-list




    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sumeet Firodia@21:1/5 to Barry Scott on Fri Mar 31 17:57:11 2023
    Hi Barry,

    This is getting more complicated.
    As per the command you shared, below is the output

    C:\Users\admin>py -3.8 -m pip --version
    pip 19.2.3 from C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\pip (python 3.8)

    For pip --version below is the output

    C:\Users\admin>pip --version
    pip 23.0.1 from C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip
    (python 3.10)

    Now if I want to upgrade the pip version it says requirement already met

    C:\Users\admin>python -m pip install --upgrade pip
    Requirement already satisfied: pip in c:\users\admin\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages
    (23.0.1)

    Please let me know how can I cleanup everything so that I dont see python 3.10.10 and can work with 3.8

    Thanks
    Sumeet

    On Fri, 31 Mar 2023 at 14:21, Barry Scott <barry@barrys-emacs.org> wrote:



    On 31 Mar 2023, at 09:33, Sumeet Firodia <ssfirodia@gmail.com> wrote:

    Thanks Barry.

    One more thing is that pip --version also refers to python 3.10

    C:\Users\admin>pip --version
    pip 23.0.1 from
    C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip
    (python 3.10)

    Use this command to ensure that pip matches the python you wish to use:

    py -3.8 -m pip --version

    Barry


    The issue here is I am trying to use snowpark for which I need python
    3.8 but because of this I am not able to proceed with next steps.

    Thanks
    Sumeet

    On Thu, 30 Mar 2023 at 22:45, Barry Scott <barry@barrys-emacs.org
    <mailto:barry@barrys-emacs.org>> wrote:


    On 30 Mar 2023, at 15:17, Sumeet Firodia <ssfirodia@gmail.com <mailto: ssfirodia@gmail.com>> wrote:


    Hi Team,

    I have installed Python 3.8 for Snowpark but when I check the version
    in
    command prompt it shows me Python 3.10.10.

    C:\Users\admin>python --version
    Python 3.10.10

    Try this:

    py -3.8

    And this to list all version of python installed:

    py -0



    Also when I try to uninstall 3.10 it says no such version is
    installed.

    C:\Users\admin>pip uninstall python 3.10.10
    WARNING: Skipping python as it is not installed.
    WARNING: Skipping 3.10.10 as it is not installed.

    PIP is for installing python modules not the python program.
    The python program is installed by running the .exe that you get from python.org <http://python.org/>, for example.
    Use the standard Windows method to uninstall a program.
    Search the web for "windows uninstall software" if you are not sure how
    to do this.

    Barry


    Can you please help me here as my snowpark assignment is stuck
    because of
    this issue.

    Thanks
    Sumeet


    --
    https://mail.python.org/mailman/listinfo/python-list

    --
    https://mail.python.org/mailman/listinfo/python-list


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Passin@21:1/5 to Sumeet Firodia on Fri Mar 31 08:49:23 2023
    On 3/31/2023 8:27 AM, Sumeet Firodia wrote:
    Hi Barry,

    This is getting more complicated.
    As per the command you shared, below is the output

    C:\Users\admin>py -3.8 -m pip --version
    pip 19.2.3 from C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\pip (python 3.8)

    For pip --version below is the output

    C:\Users\admin>pip --version
    pip 23.0.1 from C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip
    (python 3.10)

    Now if I want to upgrade the pip version it says requirement already met

    C:\Users\admin>python -m pip install --upgrade pip
    Requirement already satisfied: pip in c:\users\admin\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages
    (23.0.1)

    Please let me know how can I cleanup everything so that I dont see python 3.10.10 and can work with 3.8

    Thanks
    Sumeet

    On Fri, 31 Mar 2023 at 14:21, Barry Scott <barry@barrys-emacs.org> wrote:



    On 31 Mar 2023, at 09:33, Sumeet Firodia <ssfirodia@gmail.com> wrote:

    Thanks Barry.

    One more thing is that pip --version also refers to python 3.10

    C:\Users\admin>pip --version
    pip 23.0.1 from
    C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip
    (python 3.10)

    Use this command to ensure that pip matches the python you wish to use:

    py -3.8 -m pip --version

    Barry


    The issue here is I am trying to use snowpark for which I need python
    3.8 but because of this I am not able to proceed with next steps.

    Thanks
    Sumeet

    On Thu, 30 Mar 2023 at 22:45, Barry Scott <barry@barrys-emacs.org
    <mailto:barry@barrys-emacs.org>> wrote:


    On 30 Mar 2023, at 15:17, Sumeet Firodia <ssfirodia@gmail.com <mailto:
    ssfirodia@gmail.com>> wrote:


    Hi Team,

    I have installed Python 3.8 for Snowpark but when I check the version
    in
    command prompt it shows me Python 3.10.10.

    C:\Users\admin>python --version
    Python 3.10.10

    Try this:

    py -3.8

    And this to list all version of python installed:

    py -0



    Also when I try to uninstall 3.10 it says no such version is
    installed.

    C:\Users\admin>pip uninstall python 3.10.10
    WARNING: Skipping python as it is not installed.
    WARNING: Skipping 3.10.10 as it is not installed.

    PIP is for installing python modules not the python program.
    The python program is installed by running the .exe that you get from
    python.org <http://python.org/>, for example.
    Use the standard Windows method to uninstall a program.
    Search the web for "windows uninstall software" if you are not sure how
    to do this.

    Barry


    Can you please help me here as my snowpark assignment is stuck
    because of
    this issue.

    We have been telling you to type "py -3.8" instead of typing "python".
    We have been telling you to type "py -3.8 -m pip" instead of "python -m
    pip". Now you complain that you did something else and got a wrong result.

    If you want to upgrade pip for Python 3.8, then follow the pattern and
    type "py -3.8 -m pip install --upgrade pip". Everywhere you would have
    typed "python" type "py -3.8" instead.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eryk Sun@21:1/5 to Sumeet Firodia on Fri Mar 31 13:18:17 2023
    On 3/31/23, Sumeet Firodia <ssfirodia@gmail.com> wrote:

    One more thing is that pip --version also refers to python 3.10

    C:\Users\admin>pip --version
    pip 23.0.1 from
    C:\Users\admin\AppData\Local\Packages \PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0 \LocalCache\local-packages\Python310\site-packages\pip
    (python 3.10)

    You're running pip from the store app distribution of Python 3.10.
    Your settings have the store app set as the default for the "python"
    and "pip" commands. To change this, open the system settings for "App
    execution aliases" and disable the "python.exe", "pythonw.exe", and
    "pip.exe" aliases. You might have to also disable the alias for
    "python3.exe" if it's causing problems (e.g. if you don't want a
    shebang like "#!/usr/bin/env python3" to run the store app). It
    shouldn't cause problems to leave the "python3.10.exe" and
    "pip3.10.exe" aliases enabled.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eryk Sun@21:1/5 to Thomas Passin on Fri Mar 31 16:02:35 2023
    On 3/31/23, Thomas Passin <list1@tompassin.net> wrote:

    The store app doesn't install py.exe, does it?

    That's a significant downside of the store app. You can install Python
    3.7-3.11 from the store, and run them explicitly as "python3.7.exe", "pip3.7.exe", "python3.11.exe", "pip3.11.exe", etc. But without the
    launcher there's no shebang support for scripts, so you can't easily
    associate a script with a particular Python version or a particular
    virtual environment. Shell shortcuts/links (.LNK files) can work
    around the lack of shebang support (add .LNK to the PATHEXT
    environment variable). But having to create a separate shell link is inconvenient, and it's not cross-platform.

    The OP installed the standard Python 3.8 distribution, which does
    install the launcher by default. The launcher can run all installed
    versions, including store app installations. By default it runs the
    highest available version, which will probably be the 3.10 store app
    in the OP's case. To make 3.8 the default without having to remove
    3.10, set the environment variables "PY_PYTHON=3.8" and
    "PY_PYTHON3=3.8" in the user environment.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Passin@21:1/5 to Eryk Sun on Fri Mar 31 16:16:15 2023
    On 3/31/2023 2:18 PM, Eryk Sun wrote:
    On 3/31/23, Sumeet Firodia <ssfirodia@gmail.com> wrote:

    One more thing is that pip --version also refers to python 3.10

    C:\Users\admin>pip --version
    pip 23.0.1 from
    C:\Users\admin\AppData\Local\Packages
    \PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0
    \LocalCache\local-packages\Python310\site-packages\pip
    (python 3.10)

    You're running pip from the store app distribution of Python 3.10.
    Your settings have the store app set as the default for the "python"
    and "pip" commands. To change this, open the system settings for "App execution aliases" and disable the "python.exe", "pythonw.exe", and
    "pip.exe" aliases. You might have to also disable the alias for
    "python3.exe" if it's causing problems (e.g. if you don't want a
    shebang like "#!/usr/bin/env python3" to run the store app). It
    shouldn't cause problems to leave the "python3.10.exe" and
    "pip3.10.exe" aliases enabled.

    Ha! The store app doesn't install py.exe, does it? I forgot about that
    as a possibility, because I've always stayed away from store apps. If it
    were me, I'd uninstall the store app and get an installer from python.org.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Barry Scott@21:1/5 to All on Sat Apr 1 10:52:53 2023
    On 31 Mar 2023, at 22:02, Eryk Sun <eryksun@gmail.com> wrote:


    The OP installed the standard Python 3.8 distribution, which does
    install the launcher by default. The launcher can run all installed
    versions, including store app installations. By default it runs the
    highest available version, which will probably be the 3.10 store app
    in the OP's case. To make 3.8 the default without having to remove
    3.10, set the environment variables "PY_PYTHON=3.8" and
    "PY_PYTHON3=3.8" in the user environment.

    I find user environment on windows to be less flexible to work with then
    adding a py.ini. On my Windows 11 I added %userprofile%\AppData\Local\py.ini. To make python 3.8 the default that py.exe uses put this in py.ini:

    [defaults]
    python=3.8-64
    python3=3.8-64

    Barry


    --
    https://mail.python.org/mailman/listinfo/python-list


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eryk Sun@21:1/5 to Barry Scott on Sat Apr 1 10:08:49 2023
    On 4/1/23, Barry Scott <barry@barrys-emacs.org> wrote:

    I find user environment on windows to be less flexible to work with then adding a py.ini. On my Windows 11 I added
    %userprofile%\AppData\Local\py.ini.
    To make python 3.8 the default that py.exe uses put this in py.ini:

    [defaults]
    python=3.8-64
    python3=3.8-64

    Using "py.ini" has the advantage that launcher always reads the file.
    The value of the environment variables, on the other hand, may be
    stale. If you keep a lot of shells running, it would be tedious to
    have to manually update the PY_PYTHON* variables in each shell. That
    said, it should be rare that one needs to change the persisted default versions. For temporary changes, the PY_PYTHON* environment variables
    are more flexible and take precedence over "py.ini".

    If one doesn't use "py.ini" to set the defaults, it's easy to modify
    the persisted user environment using "setx.exe"[^1]. For example:

    setx.exe PY_PYTHON 3.8
    setx.exe PY_PYTHON3 3.8

    setx.exe broadcasts a WM_SETTINGCHANGE "Environment" window message,
    which causes Explorer to update its environment. Thus any program run
    from Explorer will see the new values. A program launched in a new tab
    in Windows Terminal also gets a fresh environment. However, existing
    CLI shells (CMD, PowerShell, bash), and programs started by them, will
    still have the old environment values. The latter is where using
    "py.ini" to set the defaults has the advantage.

    ---

    [^1]: Note that "setx.exe" should never be used to set the persisted
    user or machine "Path" value to the current %PATH%. When loading the environment, the user "Path" gets appended to the machine "Path".
    Setting the entire expanded and concatenated value to one or the other
    leads to a bloated, redundant PATH value, and it also loses the
    flexible configuration based on REG_EXPAND_SZ values.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sumeet Firodia@21:1/5 to Eryk Sun on Tue Apr 4 17:14:19 2023
    So I disabled the manage app execution for python 3.10, created the py.ini
    file and executed setx.exe PY_PYTHON 3.8, setx.exe PY_PYTHON3 3.8.
    After that i uninstalled 3.8 and reinstalled and now the version is showing correctly.

    Thanks everyone for the help.

    Thanks
    Sumeet

    On Sat, 1 Apr 2023 at 20:40, Eryk Sun <eryksun@gmail.com> wrote:

    On 4/1/23, Barry Scott <barry@barrys-emacs.org> wrote:

    I find user environment on windows to be less flexible to work with then adding a py.ini. On my Windows 11 I added %userprofile%\AppData\Local\py.ini.
    To make python 3.8 the default that py.exe uses put this in py.ini:

    [defaults]
    python=3.8-64
    python3=3.8-64

    Using "py.ini" has the advantage that launcher always reads the file.
    The value of the environment variables, on the other hand, may be
    stale. If you keep a lot of shells running, it would be tedious to
    have to manually update the PY_PYTHON* variables in each shell. That
    said, it should be rare that one needs to change the persisted default versions. For temporary changes, the PY_PYTHON* environment variables
    are more flexible and take precedence over "py.ini".

    If one doesn't use "py.ini" to set the defaults, it's easy to modify
    the persisted user environment using "setx.exe"[^1]. For example:

    setx.exe PY_PYTHON 3.8
    setx.exe PY_PYTHON3 3.8

    setx.exe broadcasts a WM_SETTINGCHANGE "Environment" window message,
    which causes Explorer to update its environment. Thus any program run
    from Explorer will see the new values. A program launched in a new tab
    in Windows Terminal also gets a fresh environment. However, existing
    CLI shells (CMD, PowerShell, bash), and programs started by them, will
    still have the old environment values. The latter is where using
    "py.ini" to set the defaults has the advantage.

    ---

    [^1]: Note that "setx.exe" should never be used to set the persisted
    user or machine "Path" value to the current %PATH%. When loading the environment, the user "Path" gets appended to the machine "Path".
    Setting the entire expanded and concatenated value to one or the other
    leads to a bloated, redundant PATH value, and it also loses the
    flexible configuration based on REG_EXPAND_SZ values.
    --
    https://mail.python.org/mailman/listinfo/python-list


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)