windows下安裝Python的XlsxWriter模塊方法
在windows環(huán)境下安裝python的XlsxWriter模塊,雖然很簡單,但由于自己粗心,少了一個字符,導致不少的錯誤。。。
1、通過pip命令來安裝。
C:\Users\Administrator>pip install XlsWriter Collecting XlsWriter Could not find a version that satisfies the requirement XlsWriter (from versions: ) No matching distribution found for XlsWriter You are using pip version 7.1.2, however version 8.1.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.
2、誤以為是由于pip的版本太低,所以根據(jù)錯誤信息中的提示,更新pip
其中可以看到,會先下載,然后檢測到有先前的版本,所以會先卸載,最后安裝新版本的pip。
C:\Users\Administrator>python -m pip install --upgrade pip Collecting pip Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB) 100% |████████████████████████████████| 1.2MB 61kB/s Installing collected packages: pip Found existing installation: pip 7.1.2 Uninstalling pip-7.1.2: Successfully uninstalled pip-7.1.2 Successfully installed pip-8.1.1
3、再次嘗試安裝,還是報錯,覺得很奇怪,到底是什么地方錯了,仔細看了一下,才發(fā)現(xiàn)是犯了低級錯誤鄙視,應該是 XlsxWriter 而不是XlsWriter,就是少了一個字符x導致報錯:找不到要求安裝的XlsWriter的一個版本。
C:\Users\Administrator>pip install XlsWriter Collecting XlsWriter Could not find a version that satisfies the requirement XlsWriter (from versions: ) No matching distribution found for XlsWriter
4、這次總算下載成功,并安裝了大笑。
C:\Users\Administrator>pip install XlsxWriter Collecting XlsxWriter Downloading XlsxWriter-0.8.6-py2.py3-none-any.whl (134kB) 100% |████████████████████████████████| 143kB 26kB/s Installing collected packages: XlsxWriter Successfully installed XlsxWriter-0.8.6
5、另一種方法是,通過eays_install來安裝XlsxWriter模塊。
C:\Users\Administrator>easy_install XlsxWriter Searching for XlsxWriter Best match: XlsxWriter 0.8.6 Adding XlsxWriter 0.8.6 to easy-install.pth file Using c:\python27\lib\site-packages Processing dependencies for XlsxWriter Finished processing dependencies for XlsxWriter
6、接下來驗證一下,是否安裝成功。
這里打開cmd,輸入python,這樣就進入到python的交互環(huán)境。
最簡單的方法就是 import 這個模塊,如果沒報錯,就說明安裝成功了。
這里特別要強調(diào)的是雖然上面的模塊名稱是XlsxWriter,但是在這里import時,都是小寫的xlsxwriter,只要有一個字符不同,就會報錯。
C:\Users\Administrator>python Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import xlsxwriter >>>
不得不說,安裝python的各種模塊,非常的方便,很贊大笑
關(guān)于XlsxWriter模塊的詳細參考信息可以查閱:https://xlsxwriter.readthedocs.io/
以上這篇windows下安裝Python的XlsxWriter模塊方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
- python利用xlsxwriter模塊 操作 Excel
- 使用python庫xlsxwriter庫來輸出各種xlsx文件的示例
- Python3讀寫Excel文件(使用xlrd,xlsxwriter,openpyxl3種方式讀寫實例與優(yōu)劣)
- Python使用pandas和xlsxwriter讀寫xlsx文件的方法示例
- Python XlsxWriter模塊Chart類用法實例分析
- Python實現(xiàn)定制自動化業(yè)務流量報表周報功能【XlsxWriter模塊】
- python xlsxwriter創(chuàng)建excel圖表的方法
- python操作excel的包(openpyxl、xlsxwriter)
- python操作excel的方法(xlsxwriter包的使用)
- python XlsxWriter模塊創(chuàng)建aexcel表格的實例講解
- Python中XlsxWriter模塊簡介與用法分析
- python xlsxwriter模塊的使用
相關(guān)文章
Python pandas之求和運算和非空值個數(shù)統(tǒng)計
數(shù)據(jù)處理的過程中經(jīng)常會遇到判斷空值和求和運算的需求,所以下面這篇文章主要給大家介紹了關(guān)于Python pandas之求和運算和非空值個數(shù)統(tǒng)計的相關(guān)資料,需要的朋友可以參考下2021-08-08
Keras搭建分類網(wǎng)絡(luò)平臺VGG16?MobileNet?ResNet50
這篇文章主要為大家介紹了Keras搭建分類網(wǎng)絡(luò)平臺VGG16?MobileNet?ResNet50,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-05-05
python subprocess pipe 實時輸出日志的操作
這篇文章主要介紹了python subprocess pipe 實時輸出日志的操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-12-12
Python的Bottle框架中返回靜態(tài)文件和JSON對象的方法
這篇文章主要介紹了Python的Bottle框架中返回靜態(tài)文件和JSON對象的方法,Bottle框架在Python開發(fā)者中具有很高的人氣,需要的朋友可以參考下2015-04-04

