0

I'm re-writing the original post because after trying the suggestions given to me here, I'm still having the same problem with PyInstaller.
Watching videos on Python and the cmd line, I came across one about writing python code on the cmd shell, so I felt I should tried it out and see what would happen and so I got this:

C:\Users\User1>python "python" is not recognized as an internal or external command, operable program or batch file.

So I created a PATH variable in the Environment Variables, tried it again and I was able to access the shell. I also added the path to the PyInstaller to PATH, tried PyInstaller again, and got the following:

1)
C:\Users\User1>pyinstaller "test.py" "pyinstaller" is not recognized as an internal or external command, operable program or batch file.

2)
C:\Users\User1\AppData\Local\Programs\Python\Python37\Lib\site-packages\Py Installer>pyinstaller --onefile "C:\Users\User1\Desktop\test.py" "pyinstaller" is not recognized as an internal or external command, operable program or batch file.

These are the paths I added to PATH: C:\Users\User1\AppData\Local\Programs\Python\Python37;C:\Users\User1\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller

Here the PyInstaller directory as support
Directory of C:\Users\User1\AppData\Local\Programs\Python\Python37\Lib\s ite-packages\PyInstaller>dir

16/09/2019  18:32    <DIR>          .
16/09/2019  18:32    <DIR>          ..
16/09/2019  18:32    <DIR>          archive
16/09/2019  18:32    <DIR>          bootloader
16/09/2019  18:32    <DIR>          building
16/09/2019  18:31            33.914 compat.py
16/09/2019  18:31             1.630 config.py
16/09/2019  18:31             3.411 configure.py
16/09/2019  18:32    <DIR>          depend
16/09/2019  18:31               456 exceptions.py
16/09/2019  18:32    <DIR>          fake-modules
16/09/2019  18:32    <DIR>          hooks
16/09/2019  18:32    <DIR>          lib
16/09/2019  18:32    <DIR>          loader
16/09/2019  18:31             1.554 log.py
16/09/2019  18:32    <DIR>          utils
16/09/2019  18:31             3.085 __init__.py
16/09/2019  18:31             4.073 __main__.py
16/09/2019  18:32    <DIR>          __pycache__
               7 archivos         48.123 bytes
              12 dirs  33.120.616.448 free bytes

Any Ideas on why the cmd line executes the python shell, but it doesn't executes the PyInstaller?

Bert_AT
  • 95
  • 8
  • 1
    Possible duplicate of [Difference between $PATH, sys.path and os.environ](https://stackoverflow.com/questions/51288512/difference-between-path-sys-path-and-os-environ) – FlyingTeller Sep 18 '19 at 10:57
  • You are confusing `PATH` (what is relevant for `cmd` to find executables) and `PYTHONPATH` (which is accessible as `sys.path` in your python script and is searched for when you do `import`. See also the linked duplicate – FlyingTeller Sep 18 '19 at 10:58
  • @FlyingTeller - I gather that because module or an executable can found through `sys.path`, it may not be accessed through the **cmd**, right? So how can I make the cdm point to the right **PATH**? – Bert_AT Sep 18 '19 at 13:07
  • [Use this to add something to your PATH](https://stackoverflow.com/a/44272417/5012099). Make sure to restart `cmd` after you added it – FlyingTeller Sep 18 '19 at 13:13
  • @FlyingTeller I'm running windows 7, so I did this: `windows button > right click on computer > properties > Advanced system settings > Environment variables.` In the screen **user variable for user1** there were only three variables: *PYTHONPATH, TEMP, TMP.* After writing a semicolon to the last path in PYTHONPATH, I added the path to the directory where PyInstaller lives, but it didn't work. I then created a new variable called Path and added the path to PyInstaller to it, but it also didn't work. Am I doing something wrong? – Bert_AT Sep 18 '19 at 19:33
  • no, not `PYTHONPATH`, you need to add it to `PATH`, which you might have to edit at the system level – FlyingTeller Sep 19 '19 at 08:24

0 Answers0