Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

FileNotFoundError: [WinError 3] The system cannot find the path specified '<script drive>\\<script path>\\<script filename>\\User'

I get this error everytime I try running this code:

script_path = os.path.realpath(__file__)
new_abs_path = os.path.join(script_path, 'Users')
if not os.path.exists(new_abs_path):
    os.makedirs(new_abs_path)

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Try this:

import os

path = os.path.join(os.path.dirname(__file__), 'Users')
if not os.path.exists(path):
    os.makedirs(path)

You forget to take the directory of your python script. You can t create a folder inside a file…

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading