在为我的某个项目安装依赖项时,我遇到了错误的编组数据错误。如果我们使用标准的virtualenv安装,它可以正常工作而没有错误。
这是我的zc.buildout的一部分(目前导致错误的部分被注释掉):
[buildout]
versions = versions
extensions = mr.developer
unzip = true
include-site-packages = false
# FIXME
# Attempting to install from here via buildout raises a bad marshal data error
# I should note that this errors does _not_ occur when we install in a
# clean virtual environment. It only happens in buildout.
# find-links = https://<myuser>:<mypass>@www.reportlab.com/pypi/simple/rlextra/
# Temporary solution, we included the package manually and will add it as
# a develop egg, then in the "django" part further down, we need to
# include the package in the extra-paths.
develop = ${buildout:directory}/libs/rlextra-3.1.9
回溯:
Getting distribution for 'rlextra==3.1.9'.
zip_safe flag not set; analyzing archive contents...
rlextra.thirdparty.xlrd.xlsx: module references __file__
rlextra.utils.buildutils: module references __file__
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1973, in main
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1954, in with_ei_usage
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1977, in <lambda>
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 360, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 584, in easy_install
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 634, in install_item
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 829, in install_eggs
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1109, in build_and_install
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1095, in run_setup
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 33, in run_setup
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 81, in run
File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 35, in <lambda>
File "setup.py", line 78, in <module>
File "setup.py", line 73, in main
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py", line 227, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py", line 266, in zip_safe
File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py", line 402, in analyze_egg
File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py", line 433, in scan_module
ValueError: bad marshal data (unknown type code)
An error occured when trying to install rlextra 3.1.9. Look above this message for any errors that were output by easy_install.
是否有人知道可能导致此问题的原因以及如何解决此问题。我们目前通过手动下载并包含软件包来管理它(正如您在buildout配置中看到的那样),这是不理想的。
答案 0 :(得分:2)
我认为这可能与我们过去混淆被视为专有文件的方式有关。直到3个月前,我们希望隐藏的模块作为原始pyc文件传输,后缀表示其python版本,例如rml2pdf_27.pyc,rml2pdf_33.pyc等。
现在我们传输一个包含嵌入式编译代码作为数据的python文件,因此它现在不应该对包装者可见。这种变化发生在3.1.9创建之后。