python os.chdir() Windows Error 2

grossmudda at gmail.com grossmudda at gmail.com
Mon Apr 1 11:40:08 EDT 2019


Hey guys, 

I´ve got a problem importing a file with os.chdir. I´ve done a lot of research but still I can´t fix it. For any suggestions I would be so thankful!

This is what I´ve tried so far:

import os
import numpy as np
import matplotlib.pyplot as plt

os.chdir('C:\Users\Ayla\Documents\Uni\Master_Umweltingenieurwesen\Study_Project\kerschbaum_input')
os.chdir('C:\\Users\Ayla\Documents\Uni\Master_Umweltingenieurwesen\Study_Project\kerschbaum_input')
os.chdir('C:\\Users\\Ayla\\Documents\\Uni\\Master_Umweltingenieurwesen\\Study_Project\\kerschbaum_input')
os.chdir('C:/Users/Ayla/Documents/Uni/Master_Umweltingenieurwesen/Study_Project/kerschbaum_input')
os.chdir('C://Users/Ayla/Documents/Uni/Master_Umweltingenieurwesen/Study_Project/kerschbaum_input')
os.chdir('C://Users//Ayla//Documents//Uni/vMaster_Umweltingenieurwesen//Study_Project//kerschbaum_input')

and each of these with [r'C:..'], " instead of ', and \\?\c instead of C.
I also added the path (in advanced system settings) of the folder.

Best regards
Ayla



More information about the Python-list mailing list