我正在尝试学习机械化模块,但在做基本的事情时得到这个导入错误
我收到了这个错误
@api.multi
def handle_detail(self, order_line):
dict_item = {}
for line in order_line:
for key in
quantity_extra = int(line.quantity_extra)
if quantity_extra not in dict_item.keys():
dict_item[quantity_extra].append(line.lng)
else:
dict_item[quantity_extra] = [line.lng]
result = []
total = 0.0
for item in dict_item.keys():
lst_ing = dict_item[item]
if len(lst_ing) > 1:
result.append(
'( %s ) x %s' % (' + '.join([str(lng) for lng in lst_ing]),
str(item)))
total += (sum(lst_ing) * item)
else:
result.append('%s x %s' % (str(lst_ing[0]), str(item)))
total += (lst_ing[0] * item)
return result, total
这样做
Traceback (most recent call last):
File "C:/Users/HUNTER/PycharmProjects/Encryption/erp.py", line 2, in <module>
import mechanize
File "C:\Users\HUNTER\AppData\Local\Programs\Python\Python35-32\lib\site-packages\mechanize\__init__.py", line 119, in <module>
from _version import __version__
ImportError: No module named '_version'