Python Forum
Script File Failure-Path Error?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script File Failure-Path Error?
#11
(Nov-28-2022, 10:09 AM)jerryf Wrote: Thanks again snippsat. So to confirm my understanding-when using cmd mode python does not appear to make any reference or use of Path and PYTHONPATH environment variables in searching for the script file, and so a full pathname must always be given unless starting from the directory containing the script file. Is that correct?
Yes.

Never do this.
C:\Users\jerry>hello_world.py
Now is the reliance on that file associations is correct and this can suddently change.
Use python,the you know that it will use Python 3.11.
C:\Users\jerry>python hello_world.py
Also when you later when need to configure editor/IDE you point to python.exe and what file associations is set to dosn't matter.
# A test to make sure with full path to python.exe
C:\Users>python -c "import sys; print(sys.executable)"
C:\python310\python.exe
You could also look into py,can by used to run any python version.
See that i have python 3.11,but still have python in OS Path that point to 3.10
# <py> will find newest one and don't care about what is OS path
G:\div_code
λ py -V
Python 3.11.0

G:\div_code
λ python -V
Python 3.10.5
I have some versions as you see👀
G:\div_code
λ py --list
 -V:3.11 *        Python 3.11 (64-bit)
 -V:3.10          Python 3.10 (64-bit)
 -V:3.9           Python 3.9 (64-bit)
 -V:3.8           Python 3.8 (64-bit)
 -V:3.7-32        Python 3.7 (32-bit)
 -V:3.6-32        Python 3.6 (32-bit)
 -V:3.5-32
 -V:3.4
 -V:2.7
 -V:2.1
 -V:ContinuumAnalytics/Anaconda39-64 Anaconda py39_4.9.2
 -V:ContinuumAnalytics/Anaconda37-64 Anaconda 4.7.12
 -V:ContinuumAnalytics/Anaconda36-32 Anaconda 4.3.14
Reply


Messages In This Thread
Script File Failure-Path Error? - by jerryf - Nov-27-2022, 04:02 PM
RE: Script File Failure-Path Error? - by snippsat - Nov-27-2022, 05:08 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-27-2022, 08:19 PM
RE: Script File Failure-Path Error? - by snippsat - Nov-27-2022, 08:26 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-27-2022, 08:54 PM
RE: Script File Failure-Path Error? - by snippsat - Nov-27-2022, 09:14 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-27-2022, 11:00 PM
RE: Script File Failure-Path Error? - by snippsat - Nov-27-2022, 11:51 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-28-2022, 10:09 AM
RE: Script File Failure-Path Error? - by jerryf - Nov-28-2022, 10:33 AM
RE: Script File Failure-Path Error? - by snippsat - Nov-28-2022, 07:15 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-29-2022, 02:45 PM
RE: Script File Failure-Path Error? - by snippsat - Nov-29-2022, 07:04 PM
RE: Script File Failure-Path Error? - by jerryf - Nov-30-2022, 09:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Failure to run source command middlestudent 2 769 Sep-22-2023, 01:21 PM
Last Post: buran
  File path by adding various variables Mishal0488 2 1,130 Apr-28-2023, 07:17 PM
Last Post: deanhystad
  Dickey Fuller failure Led_Zeppelin 4 2,727 Sep-15-2022, 09:07 PM
Last Post: Led_Zeppelin
  Script Path tfernandes 8 2,369 Jul-07-2022, 09:48 PM
Last Post: tfernandes
  Simple Python script, path not defined dubinaone 3 2,765 Nov-06-2021, 07:36 PM
Last Post: snippsat
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,265 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  Assert failure jtcostel 1 1,680 Sep-03-2021, 05:28 PM
Last Post: buran
  Subprocess.Popen() not working when reading file path from csv file herwin 13 15,519 May-07-2021, 03:26 PM
Last Post: herwin
  Add file to sys.path permanently hcccs 5 8,669 Jan-31-2021, 11:26 AM
Last Post: hcccs
  Web Form to Python Script to Text File to zip file to web wfsteadman 1 2,187 Aug-09-2020, 02:12 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020