如何编辑文件权限?

发布于 2025-02-08 02:51:35 字数 1721 浏览 0 评论 0原文

我对所有这些都很新。我正在使用Windows 10,与Ubuntu和Jupyter一起使用。我正在尝试使迪斯科扩散AI 指南。我已经达到了我安装了Ubuntu,使用Anaconda插件并在Jupyter中打开.ipynb文件的地步。

但是,当我打开这些文件时,它们仅列为读取。 仅可见标记的文件标题

我运行第一个命令并正确地标识了我的gpus。但是,当我运行第二个命令时,我会收到此错误。

Google Colab not detected.
---------------------------------------------------------------------------
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'

我不知道如何更改只读的权限。当我在Windows File Explorer中打开Ubuntu文件夹时,当右键单击时,我没有选择编辑其权限的选项。我正在以管理员的身份运行Ubuntu。我环顾四周,看到有人说他们在Ubuntu中提取了Disco扩散ZIP文件,但是,我也不知道该怎么做。

先感谢您。

I'm very new to all of this. I am using Windows 10, with Ubuntu, and Jupyter. I'm trying to get Disco Diffusion AI running per this guide. I have gotten to the point where I've installed Ubuntu, used the Anaconda addons, and opened up the .ipynb files in Jupyter.

When I open these files, however, they are listed as read only.
File title with read only marker visible

I run the first command and it correctly identifies my GPUs. But when I run the second command, I get this error.

Google Colab not detected.
---------------------------------------------------------------------------
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'

I don't know how to change permissions from read-only. When I open the Ubuntu folders in Windows File Explorer, I don't have the option to edit their permissions when I right-click. I am running Ubuntu as an administrator. I have looked around and saw someone who said they extracted the disco diffusion zip file within Ubuntu, however, I don't know how to do that either.

Thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

唔猫 2025-02-15 02:51:35

您必须使用以下命令在Ubuntu终端更改许可。 (别忘了输入用户名)

sudo chown -R YourUsername .

You have to change your permission using command below at Ubuntu terminal. (Don't forget to type in your username)

sudo chown -R YourUsername .
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文