如何修复 Python ValueError:bad marshal data? [英] How to fix Python ValueError:bad marshal data?
本文介绍了如何修复 Python ValueError:bad marshal data?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 Ubuntu 中运行 flexget Python 脚本,出现错误:
Running flexget Python script in Ubuntu, I get an error:
$ flexget series forget "Orange is the new black" s03e01
Traceback (most recent call last):
File "/usr/local/bin/flexget", line 7, in <module>
from flexget import main
File "/usr/local/lib/python2.7/dist-packages/flexget/__init__.py", line 11, in <module>
from flexget.manager import Manager
File "/usr/local/lib/python2.7/dist-packages/flexget/manager.py", line 21, in <module>
from sqlalchemy.ext.declarative import declarative_base
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/__init__.py", line 8, in <module>
from .api import declarative_base, synonym_for, comparable_using, \
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/api.py", line 11, in <module>
from ...orm import synonym as _orm_synonym, \
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/__init__.py", line 17, in <module>
from .mapper import (
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/mapper.py", line 27, in <module>
from . import properties
ValueError: bad marshal data (unknown type code)
推荐答案
如果出现该错误,则 Python 模块的编译版本(.pyc 文件)可能已损坏.Gentoo Linux 提供了 python-updater
,但在 Debian 中更简单的修复方法是:删除 .pyc 文件.如果您不知道 pyc,只需将它们全部删除(以 root 身份):
If you get that error, the compiled version of the Python module (the .pyc file) is corrupt probably. Gentoo Linux provides python-updater
, but in Debian the easier way to fix: just delete the .pyc file. If you don't know the pyc, just delete all of them (as root):
find /usr -name '*.pyc' -delete
这篇关于如何修复 Python ValueError:bad marshal data?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文