美文网首页
python 日常错误

python 日常错误

作者: 爱玩保龄球 | 来源:发表于2020-02-17 20:43 被阅读0次

    -错误

    ModuleNotFoundError: No module named 'xlwt'
    

    -解决

    excel$ pip install xlwt
    bash: pip: command not found
    excel$ sudo easy_install pip
    

    =========================================================
    python3.* 需要使用python3 来安装

    excel$ pip install xlwt
    excel$ pip install xlwtDEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    Defaulting to user installation because normal site-packages is not writeable
    Requirement already satisfied: xlwt in /Users/mingliang8/Library/Python/2.7/lib/python/site-packages (1.3.0)
    excel$ pip3 install xlwt
    Collecting xlwt
      Using cached https://files.pythonhosted.org/packages/44/48/def306413b25c3d01753603b1a222a011b8621aed27cd7f89cbc27e6b0f4/xlwt-1.3.0-py2.py3-none-any.whl
    Installing collected packages: xlwt
    Successfully installed xlwt-1.3.0
    

    =========================================================

    用xlwt模块执行代码报下面的错

    ValueError: column index (256) not an int in range(256)

    xlwt 模块看源码说最大列只支持255列所以超过这个值就报错了改用xlsxwriter模块

    ImportError: No module named xlsxwriter

    pip install xlsxwriter
    

    或者

    pip3 install xlsxwriter
    

    =========================================================

    相关文章

      网友评论

          本文标题:python 日常错误

          本文链接:https://www.haomeiwen.com/subject/lakifhtx.html