python_on_whales.exceptions.DockerException: […] The process cannot access the file because it is being used by another process

huangapple go评论68阅读模式
英文:

python_on_whales.exceptions.DockerException: [...] The process cannot access the file because it is being used by another process

问题

我正在尝试在我的本地计算机上使UC伯克利的otter-grader(使用Docker的Python包)正常工作:

我从命令提示符中运行以下命令,似乎可以工作一段时间,然后出现错误:

otter grade -p submissions\ipynbs -a dist\autograder\demo-autograder_*.zip --pdfs -v
[INFO otter.grade.main] Launching Docker containers
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-fails2Hidden.ipynb in container 28299aa6a8e0...
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-fails2.ipynb in container 936846ac6e5a...
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-fails3.ipynb in container 1efe9a22d9dd...
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-fails1.ipynb in container a02da87f955b...
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-fails3Hidden.ipynb in container 9dc9a732b97a...
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-passesAll.ipynb in container bdb824858fdf...
Traceback (most recent call last):
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\Scripts\otter.exe\__main__.py", line 7, in <module>
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\click\core.py", line 1055, in main
    rv = this.invoke(ctx)
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\cli.py", line 32, in wrapper
    return f(*args, **kwargs)
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\cli.py", line 155, in grade_cli
    g = grade(*args, **kwargs)
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\grade\__init__.py", line 78, in main
    grade_dfs = launch_grade(autograder,
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\grade\containers.py", line 115, in launch_grade
    return [df.result() for df in finished_futures[0]]
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\grade\containers.py", line 115, in <listcomp>
    return [df.result() for df in finished_futures[0]]
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\concurrent\futures\_base.py", line 451, in result
    return self.__get_result()
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\concurrent\futures\_base.py", line 403, in __get_result
    raise self._exception
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\grade\containers.py", line 189, in grade_assignments
    docker.container.copy((container, container_path), local_path)
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\python_on_whales\components\container\cli_wrapper.py", line 482, in copy
    run(full_cmd + [source, destination])
  File "C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\python_on_whales\utils.py", line 177, in run
    raise DockerException(
python_on_whales.exceptions.DockerException: The docker command executed was `C:\Program Files\Docker\Docker\resources\bin\docker.EXE container cp 9dc9a732b97a7f7e0c967f09966251e44231ab27d17234db04d5a4bda6826455:/autograder/submission/demo-fails3Hidden.ipynb C:\Users\bl222\AppData\Local\Temp\tmpypvgy7rt`.
It returned with code 1
The content of stdout is ''
The content of stderr is 'remove C:\Users\bl222\AppData\Local\Temp\tmpypvgy7rt: The process cannot access the file because it is being used by another process.'

我正在使用Windows 11。

我已经使用Anaconda安装了Python:

>python --version
Python 3.10.9

我已将otter-grader安装到名为data111(我们课程的名称)的conda环境中,并下载并解

英文:

I am trying to get UC Berkeley's otter-grader (python package that uses Docker) to work on my local machine:
https://otter-grader.readthedocs.io/en/latest/tutorial.html

I run the following from the command prompt and it seems to work for awhile until I get an error:

otter grade -p submissions\ipynbs -a dist\autograder\demo-autograder_*.zip --pdfs -v
[INFO otter.grade.main] Launching Docker containers
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-fails2Hidden.ipynb in container 28299aa6a8e0...
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-fails2.ipynb in container 936846ac6e5a...
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-fails3.ipynb in container 1efe9a22d9dd...
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-fails1.ipynb in container a02da87f955b...
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-fails3Hidden.ipynb in container 9dc9a732b97a...
[INFO otter.grade.containers.grade_assignments] Grading submissions\ipynbs\demo-passesAll.ipynb in container bdb824858fdf...
Traceback (most recent call last):
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\runpy.py&quot;, line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\runpy.py&quot;, line 86, in _run_code
    exec(code, run_globals)
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\Scripts\otter.exe\__main__.py&quot;, line 7, in &lt;module&gt;
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\click\core.py&quot;, line 1130, in __call__
    return self.main(*args, **kwargs)
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\click\core.py&quot;, line 1055, in main
    rv = self.invoke(ctx)
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\click\core.py&quot;, line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\click\core.py&quot;, line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\click\core.py&quot;, line 760, in invoke
    return __callback(*args, **kwargs)
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\cli.py&quot;, line 32, in wrapper
    return f(*args, **kwargs)
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\cli.py&quot;, line 155, in grade_cli
    g = grade(*args, **kwargs)
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\grade\__init__.py&quot;, line 78, in main
    grade_dfs = launch_grade(autograder,
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\grade\containers.py&quot;, line 115, in launch_grade
    return [df.result() for df in finished_futures[0]]
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\grade\containers.py&quot;, line 115, in &lt;listcomp&gt;
    return [df.result() for df in finished_futures[0]]
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\concurrent\futures\_base.py&quot;, line 451, in result
    return self.__get_result()
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\concurrent\futures\_base.py&quot;, line 403, in __get_result
    raise self._exception
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\concurrent\futures\thread.py&quot;, line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\otter\grade\containers.py&quot;, line 189, in grade_assignments
    docker.container.copy((container, container_path), local_path)
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\python_on_whales\components\container\cli_wrapper.py&quot;, line 482, in copy
    run(full_cmd + [source, destination])
  File &quot;C:\Users\bl222\AppData\Local\anaconda3\envs\data111\lib\site-packages\python_on_whales\utils.py&quot;, line 177, in run
    raise DockerException(
python_on_whales.exceptions.DockerException: The docker command executed was `C:\Program Files\Docker\Docker\resources\bin\docker.EXE container cp 9dc9a732b97a7f7e0c967f09966251e44231ab27d17234db04d5a4bda6826455:/autograder/submission/demo-fails3Hidden.ipynb C:\Users\bl222\AppData\Local\Temp\tmpypvgy7rt`.
It returned with code 1
The content of stdout is &#39;&#39;
The content of stderr is &#39;remove C:\Users\bl222\AppData\Local\Temp\tmpypvgy7rt: The process cannot access the file because it is being used by another process.
&#39;

I am using Windows 11.

I have installed Python using Anaconda:

&gt;python --version
Python 3.10.9

I have installed otter-grader into a conda environment called data111 (the name of our course)
I have downloaded and unzipped the tutorial folder.

I open command prompt and ran conda activate data111 and then otter assign demo.ipynb dist and this successfully created the demo folder.

I installed Docker, opened it and logged in. Here is the version info from the command prompt:

&gt;docker version
Client:
 Cloud integration: v1.0.33
 Version:           24.0.2
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:53:15 2023
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.20.1 (110738)
 Engine:
  Version:          24.0.2
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.4
  Git commit:       659604f
  Built:            Thu May 25 21:52:17 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

In the command prompt I did a wsl --update. I checked the version like this:

&gt;wsl --version
WSL version: 1.2.5.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.1702

I have installed Ubuntu. I open Ubuntu and run this command for the version info:

:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy

I went to Docker Settings> Resources> WSL Integration. I turned on Enable integration with additional distros for Ubuntu. (I tried it without this too.)

I check what is running:

&gt;wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop-data    Running         2
  docker-desktop         Running         2

I have worked with my university IT and gotten administrator privileges and temporarily disabled my anti-virus. I tried uninstalling and reinstalling everything. No luck. IT is also stumped. Please help!

答案1

得分: 0

这应该在Otter-Grader v4.4.1中修复。

英文:

This should be fixed in Otter-Grader v4.4.1.

huangapple
  • 本文由 发表于 2023年6月15日 06:06:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76477878.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定