我尝试过彻底安装jython 2.7。然后是以下命令:
cd c:\jython2.7\bin
easy_install --upgrade pip
pip install openpyxl
jython
>>> from openpyxl import Workbook
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\jython2.7.0\Lib\site-packages\openpyxl\__init__.py", line 29, in <module>
from openpyxl.workbook import Workbook
File "C:\jython2.7.0\Lib\site-packages\openpyxl\workbook\__init__.py", line 5, in <module>
from .workbook import Workbook
File "C:\jython2.7.0\Lib\site-packages\openpyxl\workbook\workbook.py", line 8, in <module>
from openpyxl.worksheet import Worksheet
File "C:\jython2.7.0\Lib\site-packages\openpyxl\worksheet\__init__.py", line 4, in <module>
from .worksheet import Worksheet
File "C:\jython2.7.0\Lib\site-packages\openpyxl\worksheet\worksheet.py", line 34, in <module>
from openpyxl.cell import Cell
File "C:\jython2.7.0\Lib\site-packages\openpyxl\cell\__init__.py", line 4, in <module>
from .cell import Cell, WriteOnlyCell
File "C:\jython2.7.0\Lib\site-packages\openpyxl\cell\cell.py", line 45, in <module>
from openpyxl.styles import numbers, is_date_format
File "C:\jython2.7.0\Lib\site-packages\openpyxl\styles\__init__.py", line 5, in <module>
from .alignment import Alignment
File "C:\jython2.7.0\Lib\site-packages\openpyxl\styles\alignment.py", line 6, in <module>
from openpyxl.descriptors import Bool, MinMax, Min, Alias, NoneSet
File "C:\jython2.7.0\Lib\site-packages\openpyxl\descriptors\__init__.py", line 4, in <module>
from .base import *
ImportError: No module named base
有没有办法解决这个问题?使用Python 2.7和openpyxl时,我没有看到这个问题。