os.makedirs doesn’t understand “~” in my path October 17, 2022 by Tarik You need to expand the tilde manually: my_dir = os.path.expanduser('~/some_dir')