本文介绍了如何解决只读文件系统问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经升级到MAC(Catalina)上的最新操作系统,但是现在我遇到了 virtualenv python django 的问题.

I've upgraded to the latest OS on MAC (Catalina), but now I have problem with virtualenv, python and django.

当我执行 source ve37/bin/activate 时就可以了,但是当我执行 python manage.py runserver 时,出现如下错误,如下所示: OSError:[Errno 30]只读文件系统:'/data'

When I do source ve37/bin/activate it's fine, but when I then do python manage.py runserver I get error as follow OSError: [Errno 30] Read-only file system: '/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'

昨天,在进行所有更新之前,一切正常.

Yesterday, before updating everything worked fine.

有什么主意吗?

推荐答案

问题是由于mac os catalina中的只读文件系统

  1. 将Mac系统引导至恢复模式.(通过具有CMD + R的启动系统).

  1. Boot your mac system into recovery mode. (by bootup system with holding CMD+R).

打开终端(出现在左上方菜单的实用程序"中).

Open terminal (Present in "Utilities" in the top left menu).

只需运行命令

csrutil禁用

正常重启系统并启动

进行任何活动之前,请打开终端并运行命令.

Before doing any activity open terminal and run command.

sudo mount -uw/

sudo mount -uw /

这篇关于如何解决只读文件系统问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 03:28