简体   繁体   中英

Problem with os.makedirs() function with Python3 on Mac OS Catalina

I'm having some trouble getting the os.makedirs() function to work. I'm currently experimenting in IDLE's shell right now and this is the error I'm getting when trying to use this function:

os.makedirs('/delicious\walnut\waffles')

Error:

Traceback (most recent call last):
  File "<pyshell#48>", line 1, in <module>
    os.makedirs('/delicious\walnut\waffles')
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/delicious\\walnut\\waffles'

Im just trying to create a random new directory. I'm going through this book called "Automate the Boring Stuff" and I'm doing this as part of Chapter 8.

Its seems like the folder path you are trying to use is only available for reading, not for writing. Try changing the settings of the path.

Take a look at this:

https://support.apple.com/guide/mac-help/change-permissions-for-files-folders-or-disks-mchlp1203/mac

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM