Python Forum
"[Errno 2] No such file or directory" (.py file)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"[Errno 2] No such file or directory" (.py file)
#3
You should not have folder %20 in name,
Just make new folder with much shorter path easier to work with,place your Python files there.
From eg cmd.
# Cd down
C:\Users>cd ..

# Make a folder
C:\>mkdir my_code

# cd in
C:\>cd my_code

# Make a file 
C:\my_code>echo.> hello.py

# Look at files in folder
C:\my_code>dir
 Volume in drive C has no label.
 Volume Serial Number is EED7-45CC

 Directory of C:\my_code
  .
10.06.2024  21:49    <DIR>          ..
10.06.2024  21:49                 2 hello.py
               1 File(s)              2 bytes
               2 Dir(s)  17 600 786 432 bytes free

# Run code,i have added print('hello world')
C:\my_code>python hello.py
hello world

C:\my_code>py hello.py
hello world

# Test python and pip version
C:\my_code>python --version
Python 3.12.2

C:\my_code>pip --version
pip 24.0 from C:\Python312\Lib\site-packages\pip (python 3.12)

C:\my_code>
Reply


Messages In This Thread
RE: "[Errno 2] No such file or directory" (.py file) - by snippsat - Jun-10-2024, 07:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error (Errno 2), File upload with the Flask framework and a public IP Username_Python1 0 458 Mar-28-2024, 01:46 PM
Last Post: Username_Python1
  file open "file not found error" shanoger 8 1,631 Dec-14-2023, 08:03 AM
Last Post: shanoger
  Need to replace a string with a file (HTML file) tester_V 1 936 Aug-30-2023, 03:42 AM
Last Post: Larz60+
  How can I change the uuid name of a file to his original file? MaddoxMB 2 1,159 Jul-17-2023, 10:15 PM
Last Post: Pedroski55
  Using pyinstaller with .ui GUI files - No such file or directory error diver999 3 4,033 Jun-27-2023, 01:17 PM
Last Post: diver999
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,265 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Extract file only (without a directory it is in) from ZIPIP tester_V 1 1,227 Jan-23-2023, 04:56 AM
Last Post: deanhystad
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 1,281 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  no such file or directory in SFTP saisankalpj 2 1,768 Nov-25-2022, 11:07 AM
Last Post: DeaD_EyE
Photo Making Zip file of a file and Directory Nasir 2 1,160 Oct-07-2022, 02:01 PM
Last Post: Nasir

Forum Jump:

User Panel Messages

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