Peter
Peter

Reputation: 3669

How to run Python installed scripts via py launcher?

Using the Python Launcher works fine: py.exe -3.5 helloworld.py

This also works fine to run the corresponding pip (which is also not in PATH): py.exe -3.5 -m pip.

Is there a way to make this also work for installed scripts?


Background: This allows installing multiple Python versions in parallel, and using them easily even when they are not in PATH. But for example I can't run pyinstaller.

Is there a way to do this anyway?

Upvotes: 3

Views: 1514

Answers (1)

G. Mrx
G. Mrx

Reputation: 56

I believe the module name is incorrect. This works for me:

py -3.5 -m PyInstaller

You can see the module names via pip. For example

$ py -m pip list

on my workstation shows:

Package         Version
--------------- --------
altgraph        0.16.1
cycler          0.10.0
future          0.16.0
kiwisolver      1.0.1
macholib        1.10
matplotlib      2.2.2
numpy           1.15.0
pefile          2018.8.8
pip             10.0.1
PyInstaller     3.3.1
pyparsing       2.2.0
pypiwin32       223
python-dateutil 2.7.3
pytz            2018.5
pywin32         223
setuptools      39.0.1
six             1.11.0

Note the case of PyInstaller in the list.

Upvotes: 3

Related Questions