Django测试运行环境错误:dis上没有足够的空间

2024-05-16 05:21:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在经历一个Django tutorial, 我能够通过以下步骤执行creating a projectdatabase setupdevelopment server步骤中出现的问题。

我在虚拟环境中试过(venv)$ python manage.py runserver

输出:

Performing system checks...

System check identified no issues (0 silenced).

January 14, 2015 - 09:39:53
Django version 1.7.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

[2015-01-14 09:39:54,347 pyinotify ERROR] add_watch: cannot watch /usr/local/lib/python2.7/dist-packages/django/contrib/auth/hashers.py WD=-1, Errno=No space left on device (ENOSPC)
[2015-01-14 09:39:54,348 pyinotify ERROR] add_watch: cannot watch /usr/local/lib/python2.7/dist-packages/django/test/__init__.py WD=-1, Errno=No space left on device (ENOSPC)

检查我的分区磁盘是否空间不足

(venv) $ df

输出:

Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda1      236182272 56881792 167280052  26% /
none                   4        0         4   0% /sys/fs/cgroup
udev             1969912        4   1969908   1% /dev
tmpfs             397084     1480    395604   1% /run
none                5120        0      5120   0% /run/lock
none             1985416     3048   1982368   1% /run/shm
none              102400       28    102372   1% /run/user

我可以清楚地看到在可用的部分几乎没有空闲空间。

以前有人在Django运行服务器时遇到过这个错误吗。


Tags: djangorunpynoneaddsettingsservervenv
3条回答

您可以尝试this链接。

基本上对我有效的是我使用了前三个命令:

sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove

然后我重新启动了我的开发服务器,我没有看到错误。

你可能已经达到你的手表配额了。

要查找当前限制,请在终端中键入:

cat /proc/sys/fs/inotify/max_user_watches

默认情况下是8192。

若要增加限制,请键入以下内容:

sudo sysctl fs.inotify.max_user_watches=16384

然后重启django。

要永久设置此限制,请键入:

echo 16384 | sudo tee -a /proc/sys/fs/inotify/max_user_watches

有一个非常详细的答案,你可以在这里找到更多信息:https://unix.stackexchange.com/a/13757/79648

我试过了

$virtualenv-3.4 -p /usr/bin/python3.4 venv 
Running virtualenv with interpreter /usr/bin/python3.4
Using base prefix '/usr'
New python executable in venv/bin/python3.4
Also creating executable in venv/bin/python
Installing setuptools, pip...done.

工作目录

$ source venv/bin/activate

我又安装了Django。

(venv)$ python manage.py runserver
       Performing system checks...

System check identified no issues (0 silenced).
January 15, 2015 - 18:56:44
Django version 1.7.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

它非常整洁,没有PyNotify错误

相关问题 更多 >