gpt4 book ai didi

python - 如何解决只读文件系统问题?

转载 作者:行者123 更新时间:2023-12-01 07:05:01 26 4
gpt4 key购买 nike

我已升级到 MAC (Catalina) 上的最新操作系统,但现在我遇到 virtualenvpythondjango 问题。

当我执行 source ve37/bin/activate 时,一切都很好,但是当我执行 python manage.py runserver 时,我收到如下错误 OSError: [ Errno 30]只读文件系统:'/data'

完整错误如下:

Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/Users/my_name/Projects/my_project/ve37/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/Users/my_name/Projects/my_project/ve37/lib/python3.7/site-packages/django/core/management/__init__.py", line 325, in execute
settings.INSTALLED_APPS
File "/Users/my_name/Projects/my_project/ve37/lib/python3.7/site-packages/django/conf/__init__.py", line 57, in __getattr__
self._setup(name)
File "/Users/my_name/Projects/my_project/ve37/lib/python3.7/site-packages/django/conf/__init__.py", line 44, in _setup
self._wrapped = Settings(settings_module)
File "/Users/my_name/Projects/my_project/ve37/lib/python3.7/site-packages/django/conf/__init__.py", line 107, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/Users/my_name/Projects/my_project/ve37/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/my_name/Projects/my_project/Autralis/Autralis/__init__.py", line 2, in <module>
from .celery import app as celery_app
File "/Users/my_name/Projects/my_project/Autralis/Autralis/celery.py", line 4, in <module>
from Autralis import settings
File "/Users/my_name/Projects/my_project/Autralis/Autralis/settings.py", line 431, in <module>
os.makedirs(GENERATED_ROOT)
File "/Users/my_name/Projects/my_project/ve37/bin/../lib/python3.7/os.py", line 211, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/Users/my_name/Projects/my_project/ve37/bin/../lib/python3.7/os.py", line 221, in makedirs
mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/data'

昨天,更新之前一切正常。

有什么想法吗?

最佳答案

由于 mac os catalina 中的只读文件系统而出现问题

  1. 将您的 Mac 系统引导至恢复模式。(通过按住 CMD+R 启动系统)。

  2. 打开终端(位于左上角菜单的“实用程序”中)。

  3. 只需运行命令

    csrutil 禁用

  4. 重新启动系统并正常启动

  5. 在执行任何事件之前,打开终端并运行命令。

    sudo mount -uw/

关于python - 如何解决只读文件系统问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58480473/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com