Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Django shell没有';不行?_Python_Django - Fatal编程技术网

Python Django shell没有';不行?

Python Django shell没有';不行?,python,django,Python,Django,当我启动django shell时,我得到了这个内存错误! 我在没有root权限的共享主机上。我不能安装Ipython,但我需要外壳 $ 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",

当我启动django shell时,我得到了这个内存错误! 我在没有root权限的共享主机上。我不能安装Ipython,但我需要外壳

$ 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 manage.py shell
回溯(最近一次呼叫最后一次):
文件“manage.py”,第15行,在
执行\u管理器(设置)
文件“/django/core/management/\uuuuu init\uuuuuu.py”,第438行,在执行管理器中
utility.execute()
文件“/django/core/management/_init__.py”,第379行,在execute中
self.fetch_命令(子命令)。从_argv(self.argv)运行_
文件“/django/core/management/base.py”,第191行,在运行时从
self.execute(*args,**选项._dict__;
文件“/django/core/management/base.py”,执行中的第218行
输出=self.handle(*args,**选项)
文件“/django/core/management/base.py”,第347行,在句柄中
返回self.handle\u noargs(**选项)
handle_noargs中的文件“/django/core/management/commands/shell.py”,第26行
进口伊皮顿
文件“/usr/lib64/python2.7/site packages/IPython/_init__.py”,第58行,在
__导入(名称、全局、loc、[])
文件“/usr/lib64/python2.7/site packages/IPython/Shell.py”,第30行,在
导入ctypes
文件“/usr/lib64/python2.7/ctypes/_init__.py”,第555行,在
_重置_缓存()
文件“/usr/lib64/python2.7/ctypes/_init__.py”,第279行,在_reset_缓存中
CFUNCTYPE(c_int)(lambda:None)
记忆者
您可以使用--plain选项


也许这个答案可以帮助您:

请检查/tmp目录上的设置。is也设置了粘性位吗?如果您使用ls-ltrd/tmp,它应该类似于以下内容

#ls-ltrd/tmp
DRWXRWT 6根根根4096 2月5日16:43/tmp


如果特别安装了/tmp,您也可以尝试重新安装它(您需要是root用户才能这样做)。我的/tmp目录有问题,所以我卸载了它并重新创建了一个新版本的/tmp。然后,对于我的应用程序,上述错误消失了。

安装Python软件包不需要root权限。安装venv并在本地全部安装。