MohamadZeina/Disco_Diffusion_Local

No Write Permissions

cambarnes7 opened this issue · 8 comments

After opening jupyter notebook and using either the included v5 or the most recent v5.2 .ipynb file, running some of the cells results in an error due to not having the permissions to write files. Jupyter still seems to be able to read files, as I can manually create folders and Jupyter will be able to read them, but it's unable to write folders or files to those folders.

What is the exact error message you’re getting?

(base) leapingliger@DESKTOP-4OBO8O9:$ conda activate pytorch_110
(pytorch_110) leapingliger@DESKTOP-4OBO8O9:
$ jupyter notebook
[I 10:45:30.803 NotebookApp] Serving notebooks from local directory: /home/leapingliger
[I 10:45:30.803 NotebookApp] Jupyter Notebook 6.4.8 is running at:
[I 10:45:30.803 NotebookApp] http://localhost:8888/?token=ed10ef6bcb22e8b5fbccfdcea3ca23725c85eb0b77ca205d
[I 10:45:30.803 NotebookApp] or http://127.0.0.1:8888/?token=ed10ef6bcb22e8b5fbccfdcea3ca23725c85eb0b77ca205d
[I 10:45:30.803 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:45:31.945 NotebookApp]

To access the notebook, open this file in a browser:
    file:///home/leapingliger/.local/share/jupyter/runtime/nbserver-187-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/?token=ed10ef6bcb22e8b5fbccfdcea3ca23725c85eb0b77ca205d
 or http://127.0.0.1:8888/?token=ed10ef6bcb22e8b5fbccfdcea3ca23725c85eb0b77ca205d

tcgetpgrp failed: Not a tty
Start : This command cannot be run due to the error: The system cannot find the file specified.
At line:1 char:1

  • Start "file:///home/leapingliger/.local/share/jupyter/runtime/nbserve ...
  •   + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
      + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
    
    

[I 10:45:48.072 NotebookApp] 302 GET /?token=ed10ef6bcb22e8b5fbccfdcea3ca23725c85eb0b77ca205d (127.0.0.1) 0.350000ms
[W 10:45:54.860 NotebookApp] 403 GET /api/contents/Disco_Diffusion_Local-main/Disco_Diffusion_v5_2_%5Bw_VR_Mode%5D.ipynb/checkpoints?=1650649553965 (127.0.0.1): Permission denied: Disco_Diffusion_Local-main/.ipynb_checkpoints
[W 10:45:54.860 NotebookApp] Permission denied: Disco_Diffusion_Local-main/.ipynb_checkpoints
[W 10:45:54.861 NotebookApp] 403 GET /api/contents/Disco_Diffusion_Local-main/Disco_Diffusion_v5_2
%5Bw_VR_Mode%5D.ipynb/checkpoints?_=1650649553965 (127.0.0.1) 5.700000ms referer=http://localhost:8888/notebooks/Disco_Diffusion_Local-main/Disco_Diffusion_v5_2_%5Bw_VR_Mode%5D.ipynb
[I 10:45:54.875 NotebookApp] Kernel started: 3720a2c4-e8d2-4c66-8b31-fe711a3c45e8, name: python3

Now getting this error when opening the .ipynb file, running each cell doesn't seem to show anything in the terminal anymore.

Did you manage to get to the bottom of this? You say no output in the terminal - but is the notebook running as expected?

I actually ended up using a different tutorial which uses VS instead of Jupyter which worked flawlessly without any errors. Since then I have reinstalled Windows so I probably cannot recreate this issue anymore. The first few cells did run with no errors but when it needed to write any files / folders, the cell output usually gave an error and the terminal would have many messages saying it failed to write to those files / folders, stating it had no permissions to do so.

I ran into the same issue. I had unpacked the downloaded zip file in windows. This saved the files as root, not as the user I entered on creation of Ubuntu. Deleting the folder and unzipping within Ubuntu solved the issue for me.

I ran into the same issue. I had unpacked the downloaded zip file in windows. This saved the files as root, not as the user I entered on creation of Ubuntu. Deleting the folder and unzipping within Ubuntu solved the issue for me.

Can you give a step by step on how you did this?

Here is my error, btw
PermissionError Traceback (most recent call last)
Input In [2], in <cell line: 37>()
34 print(f'filepath {filepath} exists.')
36 initDirPath = f'{root_path}/init_images'
---> 37 createPath(initDirPath)
38 outDirPath = f'{root_path}/images_out'
39 createPath(outDirPath)

Input In [2], in createPath(filepath)
29 def createPath(filepath):
30 if path.exists(filepath) == False:
---> 31 os.makedirs(filepath)
32 print(f'Made {filepath}')
33 else:

File ~/anaconda3/envs/pytorch_110/lib/python3.9/os.py:225, in makedirs(name, mode, exist_ok)
223 return
224 try:
--> 225 mkdir(name, mode)
226 except OSError:
227 # Cannot rely on checking for EEXIST, since the operating system
228 # could give priority to other errors like EACCES or EROFS
229 if not exist_ok or not path.isdir(name):

PermissionError: [Errno 13] Permission denied: './init_images'

Can you give a step by step on how you did this?

I rebooted and logged in using the WSL credentials, then deleted the already unpacked DiscoDiffusion folder by typing

sudo rm -rf Disco_Diffusion_Local-main

at the command prompt. After this, I installed unzip with

sudo apt install unzip

and used the now available unzip command to unpack the zip again:

unzip Disco_Diffusion_Local-main.zip

This will create a new Disco_Diffusion_Local-main subfolder that you should have write access to. You can verify that the user is no longer root but the user you defined on the creation of the WSL environment by using ls -al.

Can you give a step by step on how you did this?

I rebooted and logged in using the WSL credentials, then deleted the already unpacked DiscoDiffusion folder by typing

sudo rm -rf Disco_Diffusion_Local-main

at the command prompt. After this, I installed unzip with

sudo apt install unzip

and used the now available unzip command to unpack the zip again:

unzip Disco_Diffusion_Local-main.zip

This will create a new Disco_Diffusion_Local-main subfolder that you should have write access to. You can verify that the user is no longer root but the user you defined on the creation of the WSL environment by using ls -al.

Thank you. This fixed it.