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)
#11
The problem is here:
    textposition = "outside"
    text = ["+60", "+80", "" "-40", "-20", "Total"]
    y = [60, 80, 0, -40, -20, 0]
You need commas between arguments in a function call.
fig = go.Figure(go.Waterfall(
    measure = ["relative", "relative", "total", "relative", "relative, "total"]   "Sales  # What is this?
    x = ["Sales", "Consulting", "Net revenue", "Purchases", "Other Expenses", "Profit Before Tax"],
    textposition = "outside",
    text = ["+60", "+80", "" "-40", "-20", "Total"],
    y = [60, 80, 0, -40, -20, 0],
    connector = "line":{"color":"rgb(63, 63, 63)"},)   # Comma here not needed.
There is a problem with "Sales. What is it supposed to be? As a string you need an end quote, but fixing that, you still have an error. Is sales supposed to be part of measure? Is sales a different argument. If so , you need to provide an argument name (argument_name="Sales"),
Reply
#12
Thank you for this, it was fixed and "Sales" was deleted. It had to do with the following line (x-axis: sales, consulting, net revenue...).

However, I still get an error code when trying to run the file because "plotly" is not installed.

I need to get "pip" first but for this, the following directory: 'C:\Users\ibrah\AppData\Local\Programs\Python\Python312\Scripts' needs to be on PATH, however when I add it and run "py get-pip.py" the same warning is rendered:

Error:
WARNING: The scripts pip.exe, pip3.12.exe and pip3.exe are installed in 'C:\Users\ibrah\AppData\Local\Programs\Python\Python312\Scripts' which is not on PATH.
When I try to reinstall Python from the "python-3.12.4-amd.64" file, checking the "Add Python to Environment Variables" box, an error message in a window is prompted:

Error:
"Could not set file security for file 'C:\Users\ibrah\AppData\Roaming\Microsoft\Installer\'.Error: 5. Verify that you have sufficient privileges to modify the security permissions for this file."
Reply
#13
Here how to change Environment Variables Path
Same as image under,but you point to where you have installed Python 3.12.
[Image: WfreEG.png]
Test with cmd(shall wok from any folder) that it work as under this is copy from my cmd:
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)
Quote:When I try to reinstall Python from the
You don't need to reinstall Python is follow and fix Path as postet over,
if you need to re-install run as Administrator(right click on install file and run as administrator).
Reply
#14
It looks like the issue might be with the space in the file path. Try enclosing the entire file path in quotes like this: py "C:\Users\ibrah\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.12\Waterfall Chart.py" This should help the command prompt interpret the path correctly.
Reply


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 429 Mar-28-2024, 01:46 PM
Last Post: Username_Python1
  file open "file not found error" shanoger 8 1,520 Dec-14-2023, 08:03 AM
Last Post: shanoger
  Need to replace a string with a file (HTML file) tester_V 1 907 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,105 Jul-17-2023, 10:15 PM
Last Post: Pedroski55
  Using pyinstaller with .ui GUI files - No such file or directory error diver999 3 3,963 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,244 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,173 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,243 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  no such file or directory in SFTP saisankalpj 2 1,735 Nov-25-2022, 11:07 AM
Last Post: DeaD_EyE
Photo Making Zip file of a file and Directory Nasir 2 1,119 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