anderlli0053 / DEV-tools

📦 General development tools for applications and games and pretty much everything else too :) . Created and maintained by Andrew Poženel - anderlli0053 . 📦
https://andrew-pozenel.xyz/
The Unlicense
105 stars 19 forks source link

Can't shim 'py.exe': File doesn't exist when installing pipx #157

Open issam-seghir opened 1 year ago

issam-seghir commented 1 year ago

Bug Report

Package Name: pipx

Current Behaviour

image

i install python with pyenv , and pyenv is installed with scoop this is the location of python (where python)

E:\Apps\scoop\apps\pyenv\current\pyenv-win\shims\python
E:\Apps\scoop\apps\pyenv\current\pyenv-win\shims\python.bat
C:\Users\<USER>\AppData\Local\Microsoft\WindowsApps\python.exe

Expected Behaviour

clean install

Possible Solution

System details

Windows version: [10]

OS architecture: [64bit]

PowerShell version: [7.3.4]

Scoop Configuration

{
  "alias": {
    "gui": "scoop-gui"
  },
  "aria2-enabled": true,
  "last_update": "2023-06-29T15:51:47.7565564+01:00",
  "scoop_repo": "https://github.com/ScoopInstaller/Scoop",
  "scoop_branch": "master"
}
anderlli0053 commented 1 year ago

Hmmm.. that's strange, because it works for me:

PS C:\Users\ander> scoop install anderlli0053_DEV-tools/pipx
WARN  Scoop uses 'aria2c' for multi-connection downloads.
WARN  Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
WARN  To disable this warning, run 'scoop config aria2-warning-enabled false'.
Installing 'pipx' (1.2.0) [64bit] from anderlli0053_DEV-tools bucket
Loading pipx.pyz from cache.
Checking hash of pipx.pyz ... ok.
Linking ~\scoop\apps\pipx\current => ~\scoop\apps\pipx\1.2.0
Creating shim for 'pipx'.
'pipx' (1.2.0) was installed successfully!
PS C:\Users\ander>
issam-seghir commented 1 year ago

Hmmm.. that's strange, because it works for me:

PS C:\Users\ander> scoop install anderlli0053_DEV-tools/pipx
WARN  Scoop uses 'aria2c' for multi-connection downloads.
WARN  Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
WARN  To disable this warning, run 'scoop config aria2-warning-enabled false'.
Installing 'pipx' (1.2.0) [64bit] from anderlli0053_DEV-tools bucket
Loading pipx.pyz from cache.
Checking hash of pipx.pyz ... ok.
Linking ~\scoop\apps\pipx\current => ~\scoop\apps\pipx\1.2.0
Creating shim for 'pipx'.
'pipx' (1.2.0) was installed successfully!
PS C:\Users\ander>

Maybe you install python with Microsoft store or Globlay with msi installer?

I only installed Python using pyenv install python so the environment variable PATH does not contain the path to python.exe. It only includes the paths 'pyenv/bin' and 'pyenv/shims'

anderlli0053 commented 1 year ago

where python command returns C:\Users\ander\scoop\apps\python\current , whish means that in my case it is installed via Scoop and is on the PATH

issam-seghir commented 1 year ago

The problem occurs because pipx requires a Python launcher py.exe to be installed. However, in my case, pyenv installs Python without the launcher. This is how pyenv works for Windows, so I do not have py.exe in my system.

When I run 'py' in my terminal, I receive the following output: "py: The term 'py' is not recognized as a name of a cmdlet."

To resolve this, I need to install Python either with Scoop or using the MSI installer from the official site. Both options come with the Python launcher (py.exe).

Note: When I install Python with Scoop, I follow the instructions mentioned in the note, which state: Allow applications and third-party installers to find python by running: E:\Apps\scoop\apps\python310\current\install-pep-514.reg So, I run E:\Apps\scoop\apps\python310\current\install-pep-514.reg and accept the pop-up window to ensure that py works without any issues.

To verify that py.exe is working, type py in the terminal, and it should run the Python version installed with Scoop.

Then, I install pipx using scoop install anderlli0053_DEV-tools/pipx without any problems

update : to fix the conflcit between using python scoop version and python pyenv versions i move the pyenv path in env var to the top like this image

anderlli0053 commented 1 year ago

Thanks for the explanation.

But what am i supposed to do about that in the manifest file itself, what's even more the manifests are self-updated and fetched regularly and the changes are overwritten by preeceding manifests.