0

Windows 11. I am not great at virtual environments, and I have bumped around between a half dozen different "solutions." I thought I had it solved with chocolatey, but I am trying to install python3.11, and not having success. Basically, choco says it is installed, but I can't find it anywhere.

C:\Windows\System32>choco install --force python --version=3.11
Chocolatey v1.2.0
Installing the following packages:
python
By installing, you accept licenses for the packages.
python v3.11.0 already installed. Forcing reinstall of version '3.11.0'.
 Please use upgrade if you meant to upgrade to a new version.
Progress: Downloading python 3.11.0... 100%

python v3.11.0 (forced) [Approved]
python package files install completed. Performing other installation steps.
 The install of python was successful.
  Software installed to 'C:\ProgramData\chocolatey\lib\python'

Chocolatey installed 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

C:\Windows\System32>

This gives the impression that python would be in C:\ProgramData\chocolatey\lib\python, but the only files in that directory are python.nupkgandpython.nuspec`

Where do I go to find my shiny new python?

Adam
  • 840
  • 6
  • 24
  • 1
    Have you looked in `C:\Program Files` for a Python folder? Chocolatey is probably installing Python to `Program Files` and is pointing to it from `C:\ProgramData\chocolatey\bin`. If you're asking this in order to add Python to your path, then this shouldn't be an issue anyway. – Andrew Nov 07 '22 at 00:06
  • There's a 3.10 folder there, but no 3.11 – Adam Nov 07 '22 at 00:28
  • 1
    Perhaps it might be in `C:\Tools` – Andrew Nov 07 '22 at 00:47
  • Don't have that directory (C:\Tools) – Adam Nov 07 '22 at 01:14
  • 1
    Unfortunately there's not a lot of other places I can think of, unless you want to search your entire `C:` drive for `python.exe` in File Explorer. Chocolatey often installs packages in mysterious places. The important thing is that Chocolatey itself knows where things are. Some are bothered by that, which is understandable. If you must know where your Python install actually is, you're probably better off uninstalling it from Chocolatey and installing it the normal way/via winget. – Andrew Nov 07 '22 at 02:08
  • I wouldn't care, except that I can't figure out how to select it as my interpreter in pycharm. Or activate it in PowerShell. Or use it in any way. – Adam Nov 07 '22 at 02:36
  • 1
    Yeah, sounds like it hasn't been added to your path. My final suggestion (besides doing a drive-wide search) is to add `C:\ProgramData\chocolatey\bin` and `C:\ProgramData\chocolatey\lib` to your path. If even after doing that, you can't use the `python` command in your terminal, then Chocolatey definitely messed up. There isn't much else you can do in that case besides maybe deleting Chocolatey and installing it from scratch, but that's probably more trouble than it's worth. – Andrew Nov 07 '22 at 03:07
  • 1
    I wiped out chocolatey and went back to miniconda. Third time I have completely deleted all python and started from scratch. I think all approaches have the potential for weirdnesses/bugs that can be worked out by someone who understands what's supposed to be going on. Every time I start from scratch, I understand it a little better. Maybe this one will stick. – Adam Nov 07 '22 at 17:20

2 Answers2

1

From PowerShell, run get-command python.exe

And you will get something like this:

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     python.exe                                         0.0.0.0    C:\Users\Paul\AppData\Local\Microsoft\WindowsApps\python.exe

The Source column is where it is running python.exe from and where python is installed.

pauby
  • 683
  • 3
  • 9
1

The python package on the Chocolatey Community Repository is a metapackage. So it does not install python, instead, it has a dependency on python2 or python3 (depending on the version of python), that dependent package is what actually installs Python. So if you install python v3.11, that will have a dependency on python3 v3.11, and the python3 package will download and run the Python installer.

Instead of force installing python, try for installing python3 to rerun the Python installer.

As for the install location, packages install to $env:ChocolateyInstall\lib\. So the .nupkg, .nuspec, chocolateyInstall.ps1, etc will all be there. But the python3 package runs the Python installer, and the Python 3.11.x installer will by default install to C:\python311 when run by the chocolateyInstall.ps1 in the python3 package.