目录
2、pip指令出现SyntaxError: invalid syntax
3、ModuleNotFoundError: No module named 'thread'
4、ModuleNotFoundError: No module named 'config'
5、AttributeError: type object 'Config' has no attribute 'queue_lenght'
6、NameError: name 'buffer' is not defined
1、Tkinter回调异常问题
miniedit文件保存时,遇到Tkinter回调异常问题,具体报错信息如下:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.6/tkinter/__init__.py", line 1705, in __call__ return self.func(*args)
File "./miniedit.py", line 1707, in exportScript f. write("#!/usr/bin/env python\n")
TypeError: a bytes-like object is required, not 'str'
此种现象是安装的miniedit和Python3文件有问题,非个人编写错误。
2、pip指令出现SyntaxError: invalid syntax
原因及解决方案参考:https://blog.csdn.net/lzRush/article/details/114213053
3、ModuleNotFoundError: No module named 'thread'
from thread import start_new_thread
改为:
from _thread import start_new_thread
4、ModuleNotFoundError: No module named 'config'
参考解决方案:https://www.jianshu.com/p/5ed26aa35b9b,https://blog.csdn.net/u011728480/article/details/106783149,回到主目录下运行如下代码:
pip install config
5、AttributeError: type object 'Config' has no attribute 'queue_lenght'
原因是:“config”文件名与Python的库重名,Python库内没有方法“queue_lenght”,将自主编写的“config”文件名改为“configuration”
6、NameError: name 'buffer' is not defined
原因是:buffer在Python 2中使用,在Python 3 中已经被memoryview取代,在文件中加入:
import sys
if sys.version_info > (3,):
buffer = memoryview
7、Mininet创建拓扑之后主机之间ping不通
解决方案:https://github.com/mininet/mininet/wiki/FAQ#ethernet-loops,https://www.zhihu.com/question/266202467