Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5952

Python script not acknowledging file exists [duplicate]

$
0
0

I am experiencing an error where I am looking for a .csv file that exists on disk and the code is not acknowledging the existence of the file, which is given by an absolute path. os.path.exists() returns False when executing the script but returns True when executing in the REPL. I am using the same virtual environment to run both, and am running the script and REPL from the same directory.

I have tried:

  • Stripping the whitespace from the absolute path with strip()
  • I am using the same variable and hence consistent spelling for the absolute path
  • I have run sudo chmod -R a+rwx <path> on the file to address any potential permissions issue.

Viewing all articles
Browse latest Browse all 5952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>