<p>我从运行熊猫的回溯到:<br/>
<code>site-packages\pandas\io\excel.py line 58, in get_writer
AttributeError: 'module' object has no attribute '__version__'</code></p>
<p>我在PyInstaller repo中找到了指向git问题的链接
<a href="https://github.com/pyinstaller/pyinstaller/issues/1890" rel="nofollow">https://github.com/pyinstaller/pyinstaller/issues/1890</a>找到我的openpyxl版本,手动将其添加到get_writer方法中,如下所示:</p>
<pre><code>def get_writer(engine_name):
if engine_name == 'openpyxl':
try:
import openpyxl
#remove when conda update available
openpyxl.__version__ = '2.3.2'
# with version-less openpyxl engine
# make sure we make the intelligent choice for the user
if LooseVersion(openpyxl.__version__) < '2.0.0':
return _writers['openpyxl1']
elif LooseVersion(openpyxl.__version__) < '2.2.0':
return _writers['openpyxl20']
else:
return _writers['openpyxl22']
except ImportError:
# fall through to normal exception handling below
pass
try:
return _writers[engine_name]
except KeyError:
raise ValueError("No Excel writer '%s'" % engine_name)
</code></pre>
<p>还是没有骰子。错误回溯中给出的行号甚至没有改变。然后我将openpyxl版本更新到2.3.5,仍然收到错误消息。openpyxl<strong>init</strong>文件中有一个<strong>版本</strong>变量:</p>
^{pr2}$
<p>任何已知或潜在的修复或解决方法?在</p>