Python3安装motionless-1.1后报错的修正
来源:互联网 发布:工作室网站源码 编辑:程序博客网 时间:2024/05/02 00:27
在Python3中安装motionless1.1后,运行
import motionless
系统报错:
Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> import motionless File "<frozen importlib._bootstrap>", line 2237, in _find_and_load File "<frozen importlib._bootstrap>", line 2222, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 2164, in _find_spec File "<frozen importlib._bootstrap>", line 1940, in find_spec File "<frozen importlib._bootstrap>", line 1916, in _get_spec File "<frozen importlib._bootstrap>", line 1897, in _legacy_get_spec File "<frozen importlib._bootstrap>", line 863, in spec_from_loader File "<frozen importlib._bootstrap>", line 904, in spec_from_file_location File "C:\Python34\lib\site-packages\motionless-1.1-py3.4.egg\motionless.py", line 55 if label and (len(label) <> 1 or not label in Marker.LABELS): ^SyntaxError: invalid syntax
原因是motionless的版本虽然为motionless-1.1-py3.4,但其中很多语法仍然没有更新。
修正方法:
从C:\Python34\Lib\site-packages中找到motionless-1.1-py3.4.egg,用解压缩软件打开,找到其中的motionless.py,再用编辑软件或记事本打开,修改以下几行:
1、第1行 quote,改为parse
from urllib import parse
2、第55行和第190行中的<>改为!=
if label and (len(label) != 1 or not label in Marker.LABELS):
if self.region and self.path[0] != self.path[-1]:
3、调整第178、179、196行的缩进,与前文保持8个空格(英文模式下)
self.markers = [] self.fillcolor = fillcolor self.pathweight = pathweight self.pathcolor = pathcolor self.region = region self.path = []
if self.region and self.path[0] != self.path[-1]: raise ValueError("If region enabled, first and last path entry must be identical") if len(self.path) == 0 and len(self.markers) == 0: raise ValueError("Must specify points in path or markers") if not Color.is_valid_color(self.fillcolor): raise ValueError("%s is not a valid fill color. Must be 24 or 32 bit value or one of %s" % (self.fillcolor,Color.COLORS))
4、文中所有的quote更正为parse.quote
0 0
- Python3安装motionless-1.1后报错的修正
- Python3+Opencv3的安装
- 安装IE7 主页设置无效的修正
- ubuntu 安装的小问题修正
- 对php编译安装的修正
- ubuntu 下fcitx的安装和修正
- Centos7下Python3的安装
- python3的算法库安装
- python3下opencv的安装
- python3.4的pygame安装
- Python3系的安装教程
- python3一些工具的安装
- 关于安装Python3的文章
- python3.4的安装方法
- Python3中Scrapy的安装
- python3 库文件的安装
- Linux下的安装python3
- 安装支持 python3 的 xadmin
- 万海互联自助建站让网络营销更加简单
- 线程池
- UVA 10341Solve It(二分求方程解)
- android之ViewStub解析
- android之gson解析
- Python3安装motionless-1.1后报错的修正
- [leetcode] Symmetric Tree
- Site Analysis Note 3
- 12.8 第十二章小结
- 【重要】股票收益互换
- jQueryUI web前段展示的几种框架
- 函数声明与定义后加const的含义
- 删除Weblogic域
- PAT 01-2. Maximum Subsequence Sum (25)