I got a permisson denied error when I tried to write a file in jupyter.

Asked 2 years ago, Updated 2 years ago, 146 views

When I tried to execute the code below in Jupiter notebook, I got a permission denied error on line 14.What should I do if there is nothing that makes sense when I look into it?

  • OS
    • Windows 10
  • Jupyter notebook is open on edge
  • Windows 10
import gzip 
file=[
    "train-images-idx3-ubyte.gz",
    "train-labels-idx1-ubyte.gz",
    "t10k-images-idx3-ubyte.gz",
    "t10k-labels-idx1-ubyte.gz"
]

For fin file:
    raw_file="/"+f.replace(".gz", "")
    with gzip.open(f, "rb") as gz:
        body=gz.read()
        with open(raw_file, "wb") as raw_w:
            raw_w.write(body)

jupyter-notebook

2022-09-30 19:55

1 Answers

I noticed that the relative directory specification was incorrect in the comment.

./ or the file name was all I needed.


2022-09-30 19:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.