1

whenever i run this on my window shell:

 PS C:\python27\scripts> python pyinstaller-script.py --onefile --noconsole .F "C:\Users\Win\Desktop\Radium-Keylogger-master\Radium-Keylogger-master\rubi.py"

i got this error msg below

C:\Python27\python.exe: can't open file 'pyinstaller-script.py': [Errno 2] No such file or directory

sticky bit
  • 36,626
  • 12
  • 31
  • 42
Selfmade
  • 11
  • 1
  • Check the python version with `python - -version` in cmd. It is a wild guess but that smells version conflict – Celso Pereira Neto Apr 01 '19 at 18:47
  • when you run a script like C:/Some/Directory>python my_script.py you have to make sure that you are in the same directory of my_script.py. So either 1. add python to you path, and then cd to where that script is and run it or 3. run it from where you are now but with the full file path >python /full/file/path/to/my_script.py – amchugh89 Apr 01 '19 at 19:13
  • 1
    @CelsoPereiraNeto Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. – Selfmade Apr 01 '19 at 19:27
  • @amchugh89 can you please make example with my scripts, so i can understand well, thanks: C:\python27\scripts> python pyinstaller-script.py --onefile --noconsole .F "C:\Users\Win\Desktop\Radium-Keylogger-mas ter\Radium-Keylogger-master\rubi.py – Selfmade Apr 01 '19 at 19:31

1 Answers1

1

'python' in your command calls the python.exe executable that will execute your python code located in your script 'pyinstaller-script.py'

If you did not add 'python' to your path (in Environmental Variables), then you would have to actually be in the location of the python executable to run it, or call it by specifying the path like >\PATH\TO\PYTHON\python.exe my_script.py --myargs

From your comments, it looks like you have the path to python 3 set in your environmental variables, because even though you are in the python27 location, you get an instance of python3 when you checked the version.

So, if you need to run pyinstaller-script.py with python 2, instead of python3, then maybe try 'python.exe' instead of python (which is just a system variable that is currently looking to the python 3 exe)

BUT I personally do not think this is your issue from Error

C:\Python27\python.exe: can't open file 'pyinstaller-script.py': [Errno 2] No such file or directory

I think your problem is that you are not in the directory of pyinstaller-script.py, and since python by default looks for that script in the current directory, it is not finding it, so you will need to specify a path to where that file is located:

If you should run it with python 3

C:\ANYWHERE> python C:\PATH\TO\pyinstaller-script.py --onefile --noconsole .F "C:\Users\Win\Desktop\Radium-Keylogger-master\Radium-Keylogger-master\rubi.py"

If you should run it with python 2

C:\python27> python.exe C:\PATH\TO\pyinstaller-script.py --onefile --noconsole .F "C:\Users\Win\Desktop\Radium-Keylogger-master\Radium-Keylogger-master\rubi.py"

Note - the important addition is C:\PATH\TO\

amchugh89
  • 1,276
  • 1
  • 14
  • 33