【发布时间】:2014-06-04 21:22:01
【问题描述】:
当我启动 django shell 时,我得到了这个内存错误! 我在没有root权限的共享主机上。我无法安装 Ipython,但我需要 shell。
$ python manage.py shell
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_manager(settings)
File "/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/django/core/management/base.py", line 218, in execute
output = self.handle(*args, **options)
File "/django/core/management/base.py", line 347, in handle
return self.handle_noargs(**options)
File "/django/core/management/commands/shell.py", line 26, in handle_noargs
import IPython
File "/usr/lib64/python2.7/site-packages/IPython/__init__.py", line 58, in <module>
__import__(name,glob,loc,[])
File "/usr/lib64/python2.7/site-packages/IPython/Shell.py", line 30, in <module>
import ctypes
File "/usr/lib64/python2.7/ctypes/__init__.py", line 555, in <module>
_reset_cache()
File "/usr/lib64/python2.7/ctypes/__init__.py", line 279, in _reset_cache
CFUNCTYPE(c_int)(lambda: None)
MemoryError
【问题讨论】:
-
安装 Python 包不需要 root 权限。设置一个venv并将其全部安装在本地。