admin 发表于 2019-6-11 16:00:26

Python模块安装:xlrd-1.1.0

1. 下载
xlrd-1.1.0下载地址:https://pypi.org/project/xlrd/#files
2. 解压到Python包的安装目录
---------------------

cd xlrd-1.1.0
sudo python setup.py install
running install
running bdist_egg
running egg_info
writing xlrd.egg-info/PKG-INFO
writing top-level names to xlrd.egg-info/top_level.txt
writing dependency_links to xlrd.egg-info/dependency_links.txt
reading manifest file 'xlrd.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README.html'
writing manifest file 'xlrd.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/xlrd
creating build/bdist.linux-x86_64/egg/xlrd/doc
copying build/lib/xlrd/doc/xlrd.html -> build/bdist.linux-x86_64/egg/xlrd/doc
copying build/lib/xlrd/doc/compdoc.html -> build/bdist.linux-x86_64/egg/xlrd/doc
creating build/bdist.linux-x86_64/egg/xlrd/examples
copying build/lib/xlrd/examples/xlrdnameAPIdemo.py -> build/bdist.linux-x86_64/egg/xlrd/examples
copying build/lib/xlrd/examples/namesdemo.xls -> build/bdist.linux-x86_64/egg/xlrd/examples
copying build/lib/xlrd/formula.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/licences.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/formatting.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/timemachine.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/xldate.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/sheet.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/book.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/xlsx.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/compdoc.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/biffh.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/__init__.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/info.py -> build/bdist.linux-x86_64/egg/xlrd
byte-compiling build/bdist.linux-x86_64/egg/xlrd/examples/xlrdnameAPIdemo.py to xlrdnameAPIdemo.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/formula.py to formula.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/licences.py to licences.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/formatting.py to formatting.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/timemachine.py to timemachine.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/xldate.py to xldate.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/sheet.py to sheet.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/book.py to book.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/xlsx.py to xlsx.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/compdoc.py to compdoc.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/biffh.py to biffh.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/info.py to info.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/runxlrd.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/runxlrd.py to 755
copying xlrd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xlrd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xlrd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xlrd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
xlrd.xlsx: module references __file__
creating 'dist/xlrd-1.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing xlrd-1.0.0-py2.7.egg
removing '/usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg' (and everything under it)
creating /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
Extracting xlrd-1.0.0-py2.7.egg to /usr/lib/python2.7/site-packages
xlrd 1.0.0 is already the active version in easy-install.pth
Installing runxlrd.py script to /usr/bin
Installed /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
Processing dependencies for xlrd==1.0.0
Finished processing dependencies for xlrd==1.0.0

admin 发表于 2019-6-11 16:00:59

xlrd是Python中直接读取Excel文件的包:

import xlrd

x_y_data = xlrd.open_workbook('Data.xlsx')
all_data = x_y_data.sheets()
all_rows = all_data.nrows #行数
all_cols = all_data.ncols #列数

但是其实用pandas来读取更方便(pandas内部也需要xlrd包):

import pandas as pd

df = pd.read_excel(datafile, header=None)
data = df.values

1. 下载

xlrd-1.1.0下载地址:https://pypi.org/project/xlrd/#files

admin 发表于 2019-7-16 14:49:39

python setup.py install
running install
running bdist_egg
running egg_info
writing xlrd.egg-info/PKG-INFO
writing top-level names to xlrd.egg-info/top_level.txt
writing dependency_links to xlrd.egg-info/dependency_links.txt
reading manifest file 'xlrd.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README.html'
writing manifest file 'xlrd.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/xlrd
creating build/bdist.linux-x86_64/egg/xlrd/doc
copying build/lib/xlrd/doc/xlrd.html -> build/bdist.linux-x86_64/egg/xlrd/doc
copying build/lib/xlrd/doc/compdoc.html -> build/bdist.linux-x86_64/egg/xlrd/doc
creating build/bdist.linux-x86_64/egg/xlrd/examples
copying build/lib/xlrd/examples/xlrdnameAPIdemo.py -> build/bdist.linux-x86_64/egg/xlrd/examples
copying build/lib/xlrd/examples/namesdemo.xls -> build/bdist.linux-x86_64/egg/xlrd/examples
copying build/lib/xlrd/formula.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/licences.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/formatting.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/timemachine.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/xldate.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/sheet.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/book.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/xlsx.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/compdoc.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/biffh.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/__init__.py -> build/bdist.linux-x86_64/egg/xlrd
copying build/lib/xlrd/info.py -> build/bdist.linux-x86_64/egg/xlrd
byte-compiling build/bdist.linux-x86_64/egg/xlrd/examples/xlrdnameAPIdemo.py to xlrdnameAPIdemo.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/formula.py to formula.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/licences.py to licences.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/formatting.py to formatting.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/timemachine.py to timemachine.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/xldate.py to xldate.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/sheet.py to sheet.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/book.py to book.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/xlsx.py to xlsx.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/compdoc.py to compdoc.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/biffh.py to biffh.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/xlrd/info.py to info.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/runxlrd.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/runxlrd.py to 755
copying xlrd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xlrd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xlrd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xlrd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
xlrd.xlsx: module references __file__
creating 'dist/xlrd-1.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing xlrd-1.0.0-py2.7.egg
removing '/usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg' (and everything under it)
creating /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
Extracting xlrd-1.0.0-py2.7.egg to /usr/lib/python2.7/site-packages
xlrd 1.0.0 is already the active version in easy-install.pth
Installing runxlrd.py script to /usr/bin

Installed /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
Processing dependencies for xlrd==1.0.0
Finished processing dependencies for xlrd==1.0.0
页: [1]
查看完整版本: Python模块安装:xlrd-1.1.0