Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 FileNotFoundError: No such file or no access
#1
Hello,

I am begging in python. I compile the code of and I got the error like this:

Quote: File "C:\Users\krasona\PycharmProjects\GlioblastomaSegmentation\venv\lib\site-packages\nibabel\loadsave.py", line 42, in load
raise FileNotFoundError("No such file or no access: '%s'" % filename)
FileNotFoundError: No such file or no access: 'C:\Users\krasona\PycharmProjects\GlioblastomaSegmentation\output\FLAIR_N4Bias.nii.gz'

The code looks like this :
  try:
        stat_result = os.stat(filename)
    except OSError:
        raise FileNotFoundError("No such file or no access: '%s'" % filename)
    if stat_result.st_size <= 0:
        raise ImageFileError("Empty file: '%s'" % filename)
    sniff = None
    for image_klass in all_image_classes:
        is_valid, sniff = image_klass.path_maybe_image(filename, sniff)
        if is_valid:
            img = image_klass.from_filename(filename, **kwargs)
            return img

    raise ImageFileError('Cannot work outfile type of "%s"' %
                         filename)


Could you help me to fix this issue ?

I would be appreciate for any help please.
Quote
#2
The error is quite clear.
The file C:\Users\krasona\PycharmProjects\GlioblastomaSegmentation\output\FLAIR_N4Bias.nii.gz doesn't exist, or you don't have access to it.
So check if you have the file, and if you have access.
Quote
#3
It didn't create this file.
Before It creates another files but this one was not created.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  FileNotFoundError: [Errno 2] No such file or directory saqib1066 23 807 Mar-16-2020, 01:25 PM
Last Post: saqib1066
  FileNotFoundError managment sal 2 346 Oct-23-2019, 09:18 AM
Last Post: sal
Question pdfkit.from_string('Hello!','out.pdf') gives FileNotFoundError sipriusPT 3 1,212 Sep-19-2019, 01:44 PM
Last Post: snippsat
  File access / locking. MuntyScruntfundle 1 583 Oct-16-2018, 02:41 PM
Last Post: wavic
  FileNotFoundError: [Errno 2] No such file or directory: 'movies.csv' RedSkeleton007 5 7,698 Jul-01-2018, 09:10 PM
Last Post: snippsat
  FileNotFoundError when using subprocess dixitabhi 1 11,785 Mar-04-2018, 06:59 PM
Last Post: Larz60+
  python 2.7 access denied when writing a file to Windows kavise 2 6,515 Feb-13-2018, 08:30 PM
Last Post: kavise
  Is it possible to access and list all macro names in an excel file? kwfine 0 813 Feb-07-2018, 04:21 PM
Last Post: kwfine
  where is FileNotFoundError at? Skaperen 4 9,363 Oct-03-2017, 01:49 AM
Last Post: Skaperen
  File access confusion python windows PickyBiker 0 1,550 May-08-2017, 05:36 PM
Last Post: PickyBiker

Forum Jump:


Users browsing this thread: 1 Guest(s)