Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/24.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.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无法导入名称\u比较\u摘要_Python_Django_Python 2.7 - Fatal编程技术网

Python DJANGO无法导入名称\u比较\u摘要

Python DJANGO无法导入名称\u比较\u摘要,python,django,python-2.7,Python,Django,Python 2.7,你好,我有python 7.13 DJANGO 1.11.2版本 windows 10上的django crypto 0.20版本 我想创建一个DJANGO应用程序,但任何时候尝试迁移都需要 这个错误: from django.utils.crypto import get_random_string File "C:\Python27\lib\site-packages\django\utils\crypto.py", line 8, in <module> i

你好,我有python 7.13

DJANGO 1.11.2版本

windows 10上的django crypto 0.20版本

我想创建一个DJANGO应用程序,但任何时候尝试迁移都需要

这个错误:

    from django.utils.crypto import get_random_string
  File "C:\Python27\lib\site-packages\django\utils\crypto.py", line 8, in <module>
    import hmac
  File "C:\Python27\Lib\hmac.py", line 8, in <module>
    from operator import _compare_digest as compare_digest
ImportError: cannot import name _compare_digest
从django.utils.crypto导入get\u random\u字符串
文件“C:\Python27\lib\site packages\django\utils\crypto.py”,第8行,在
进口hmac
文件“C:\Python27\Lib\hmac.py”,第8行,在
从运算符导入\u比较\u摘要作为比较\u摘要
导入错误:无法导入名称\u比较\u摘要

如何修复它?

您是否安装了operator?尝试导入operator,会发现您似乎没有安装operator,这基本上意味着您的Python安装已中断。或者您弄乱了包路径,因此
操作符
不是标准的
操作符
库。您的应用程序是否有一个
操作员
包?@Emile在我的代码中的什么位置导入操作员?上面写着我