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

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

Open
issam-seghir opened this issue Jun 29, 2023 · 5 comments
Open

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

issam-seghir opened this issue Jun 29, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@issam-seghir
Copy link

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"
}
@issam-seghir issam-seghir added the bug Something isn't working label Jun 29, 2023
@anderlli0053
Copy link
Owner

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
Copy link
Author

issam-seghir commented Jun 29, 2023

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
Copy link
Owner

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
Copy link
Author

issam-seghir commented Jun 30, 2023

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants