[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

python os.chdir() Windows Error 2

What are you actually trying to do?

os.chdir() simply changes the current working directory of your process. It
doesn't read any data or "import" or really have any affect on its own. The
current directory is the directory you ran the script from in the first
place, which is where files will be opened from. os.chdir() changes that
directory, affecting future files you access with open(), but doesn't have
a direct effect. Multiple chdir() calls in a row would simply be

On Mon, Apr 1, 2019 at 11:45 AM <grossmudda at> wrote:

> 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
> --




cspealma at  M: +1.336.210.5107