找回密码
 注册
查看: 4210|回复: 2

Python模块安装:xlrd-1.1.0

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2019-6-11 16:00:26 | 显示全部楼层 |阅读模式
1. 下载
$ a; L8 T6 ]: \  g. r. Gxlrd-1.1.0下载地址:https://pypi.org/project/xlrd/#files
2 k  c8 g. p- A9 ^- y; t0 V2. 解压到Python包的安装目录, D7 f7 }2 J; P9 x6 a* I
---------------------
) `: M, r& e* }" v  _
" w! Y$ f  a7 O) J& Y
cd xlrd-[color=rgb(0, 102, 102) !important]1.1.[color=rgb(0, 102, 102) !important]04 h! J: l2 q0 n7 [' O( F9 {5 |
sudo python setup.py install
4 x3 P" q/ `* K; s. M8 drunning install
; {8 A2 k  W/ b* m# Rrunning bdist_egg
+ s+ O' R( e  urunning egg_info
: V8 p$ e5 z" X1 S! F' `, Q9 k8 vwriting xlrd.egg-info/PKG-INFO
% e5 B+ q8 x" _9 E3 H3 b" \' @6 lwriting top-level names to xlrd.egg-info/top_level.txt
# A& X  m3 ^: Q. B2 ^  zwriting dependency_links to xlrd.egg-info/dependency_links.txt8 b* v1 ~. h) Q& q1 Q+ H+ _
reading manifest file 'xlrd.egg-info/SOURCES.txt'5 T4 ]1 `  z$ Y, `9 X
reading manifest template 'MANIFEST.in'3 g3 j- ?$ I5 w5 _5 z( |+ h- Z: }
warning: no files found matching 'README.html'
. S: d  C+ n$ t! H5 c! vwriting manifest file 'xlrd.egg-info/SOURCES.txt'
0 b; r2 ?- e7 }installing library code to build/bdist.linux-x86_64/egg! Z! c+ M" w: Z9 _/ B1 A6 ^
running install_lib
2 S2 p* r" ?( w& Urunning build_py& N7 x* w2 h) }  U( b
creating build/bdist.linux-x86_64/egg* k( C, \, c5 \7 Z/ B
creating build/bdist.linux-x86_64/egg/xlrd( G# g" q% j4 K  y9 b/ r! p
creating build/bdist.linux-x86_64/egg/xlrd/doc
# ^  v1 A- q: Xcopying build/lib/xlrd/doc/xlrd.html -> build/bdist.linux-x86_64/egg/xlrd/doc- U9 k& d3 V/ M- W8 T
copying build/lib/xlrd/doc/compdoc.html -> build/bdist.linux-x86_64/egg/xlrd/doc1 @/ }9 N! N- m/ w' T6 p* f% K
creating build/bdist.linux-x86_64/egg/xlrd/examples" ~& }  Z# o' M+ ~" x( I/ k! o
copying build/lib/xlrd/examples/xlrdnameAPIdemo.py -> build/bdist.linux-x86_64/egg/xlrd/examples/ ]7 T, M# H7 s* \
copying build/lib/xlrd/examples/namesdemo.xls -> build/bdist.linux-x86_64/egg/xlrd/examples
& u5 v( p5 `3 x% x9 J) lcopying build/lib/xlrd/formula.py -> build/bdist.linux-x86_64/egg/xlrd! b) H# T1 i7 d+ Y* p- K/ ^6 p
copying build/lib/xlrd/licences.py -> build/bdist.linux-x86_64/egg/xlrd: B( v: e7 _4 I) g8 v% @+ v
copying build/lib/xlrd/formatting.py -> build/bdist.linux-x86_64/egg/xlrd
5 j3 y5 \0 N) {8 a8 R& X6 H4 fcopying build/lib/xlrd/timemachine.py -> build/bdist.linux-x86_64/egg/xlrd/ o& w# S( n$ \7 H! ]
copying build/lib/xlrd/xldate.py -> build/bdist.linux-x86_64/egg/xlrd
, v% N4 {, }, b2 S# k0 Lcopying build/lib/xlrd/sheet.py -> build/bdist.linux-x86_64/egg/xlrd
5 p0 h# X( }% Q( ?copying build/lib/xlrd/book.py -> build/bdist.linux-x86_64/egg/xlrd
8 ~0 E: q6 E6 d1 ?* J" acopying build/lib/xlrd/xlsx.py -> build/bdist.linux-x86_64/egg/xlrd% x, d# w* }) K1 U, `
copying build/lib/xlrd/compdoc.py -> build/bdist.linux-x86_64/egg/xlrd- C/ p' @+ L! ]- s1 a
copying build/lib/xlrd/biffh.py -> build/bdist.linux-x86_64/egg/xlrd6 v  y, b+ X2 s. Z8 m
copying build/lib/xlrd/__init__.py -> build/bdist.linux-x86_64/egg/xlrd
' g  W* }, }: a; Qcopying build/lib/xlrd/info.py -> build/bdist.linux-x86_64/egg/xlrd
1 C; w2 x3 q( Y4 abyte-compiling build/bdist.linux-x86_64/egg/xlrd/examples/xlrdnameAPIdemo.py to xlrdnameAPIdemo.pyc# }- ?0 H: A  o8 a+ N7 ~% o( L
byte-compiling build/bdist.linux-x86_64/egg/xlrd/formula.py to formula.pyc+ s3 w% x9 ?# b5 j) t& R+ t
byte-compiling build/bdist.linux-x86_64/egg/xlrd/licences.py to licences.pyc
5 r# j7 D# E  h( }+ Y) }3 rbyte-compiling build/bdist.linux-x86_64/egg/xlrd/formatting.py to formatting.pyc! I( [! ~% h* k. J
byte-compiling build/bdist.linux-x86_64/egg/xlrd/timemachine.py to timemachine.pyc: @9 ?3 W7 `9 B' q
byte-compiling build/bdist.linux-x86_64/egg/xlrd/xldate.py to xldate.pyc4 `) [& j/ N1 X0 K% K
byte-compiling build/bdist.linux-x86_64/egg/xlrd/sheet.py to sheet.pyc
& Q% Q" l7 a9 m3 L: dbyte-compiling build/bdist.linux-x86_64/egg/xlrd/book.py to book.pyc
& q( F6 ]9 I; H* Wbyte-compiling build/bdist.linux-x86_64/egg/xlrd/xlsx.py to xlsx.pyc- F0 y9 w- y4 @
byte-compiling build/bdist.linux-x86_64/egg/xlrd/compdoc.py to compdoc.pyc
# ]: d  I0 ^+ D# ^byte-compiling build/bdist.linux-x86_64/egg/xlrd/biffh.py to biffh.pyc+ Y& J' T  B' H- P
byte-compiling build/bdist.linux-x86_64/egg/xlrd/__init__.py to __init__.pyc: \. Y3 x+ I- o# L
byte-compiling build/bdist.linux-x86_64/egg/xlrd/info.py to info.pyc5 R% J4 }5 ?; n  Z$ x
creating build/bdist.linux-x86_64/egg/EGG-INFO
+ p  _5 q9 M" e7 Cinstalling scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts1 O2 Z) P, @' k4 @, j
running install_scripts. E( O+ N: E( h: J  F  a0 v* g
running build_scripts
8 r* J: d+ ^6 B; _3 pcreating build/bdist.linux-x86_64/egg/EGG-INFO/scripts, Z* n  e) J! D5 Q
copying build/scripts-2.7/runxlrd.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
/ ~! g+ _6 B6 q; Lchanging mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/runxlrd.py to 755% a9 `: V) _8 l- y, n' T: W
copying xlrd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
, j) i6 Z+ X) s; Gcopying xlrd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
. F: r7 P' M& Rcopying xlrd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
4 w+ B: ~9 c; C5 {" D  w0 Bcopying xlrd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO9 R/ a& A# l% X2 j1 s4 n! g
zip_safe flag not set; analyzing archive contents...
/ d, B1 ?( s" e7 G, J: }* Q+ A% Ixlrd.xlsx: module references __file__  s( Q/ l8 D( z/ |
creating 'dist/xlrd-1.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it1 p; Y5 m- J8 D% P, T2 _" A
removing 'build/bdist.linux-x86_64/egg' (and everything under it)% k2 P& h3 B5 B# c0 G
Processing xlrd-1.0.0-py2.7.egg- r; {9 K; x9 B% u; d/ C& Z
removing '/usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg' (and everything under it)0 @' C7 r8 }4 Z
creating /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg8 M% |3 G8 y( A+ [. z, a' E
Extracting xlrd-1.0.0-py2.7.egg to /usr/lib/python2.7/site-packages1 @: A2 S& L, o
xlrd 1.0.0 is already the active version in easy-install.pth
' m: s% i6 s5 q6 T  w4 _3 x4 }% SInstalling runxlrd.py script to /usr/bin: {! C' W  n: |* K5 s! u
Installed /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg; U6 d& D+ j: L' Z- [9 ?8 r- [
Processing dependencies for xlrd==1.0.0
/ h1 t# K6 p+ _8 DFinished processing dependencies for xlrd==1.0.0, w, m9 \! w+ U! s% U8 U3 @) T, v! W

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-6-11 16:00:59 | 显示全部楼层
xlrd是Python中直接读取Excel文件的包:% @; z7 Z3 _% c+ x8 E

3 Y* f7 A4 R( k' }import xlrd
; ]  g- l" s- N* w* d! O" d) v' d8 r: k9 x' t# e+ m- M0 O
x_y_data = xlrd.open_workbook('Data.xlsx')2 `! k* P0 G* s6 M7 c
all_data = x_y_data.sheets()[0]1 X5 B( Y  A6 ?
all_rows = all_data.nrows #行数) y$ j2 K7 ~$ c7 y: ^# ]/ }: U
all_cols = all_data.ncols #列数1 B' s$ L* x! Q7 d2 |+ }( Q

7 o7 J! t1 i  k; n& N6 a但是其实用pandas来读取更方便(pandas内部也需要xlrd包):
. P0 a# v! s1 y. q8 z' W" V
* a. W- R3 s7 L& q" o# cimport pandas as pd
+ R2 L/ }! D8 y' l( T$ l( h4 _) n
9 ^2 ]5 @. k' z+ _/ `df = pd.read_excel(datafile, header=None)
6 g' x6 T/ w& mdata = df.values
4 `7 u/ B5 W  r  m4 {0 i9 A+ I, e3 G. f
1. 下载6 D- ~/ \; g% \' Q- a% q
1 K" e( X, \2 J0 Z4 L2 v
xlrd-1.1.0下载地址:https://pypi.org/project/xlrd/#files
4 M, Z5 }! L  Q

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-7-16 14:49:39 | 显示全部楼层
python setup.py install+ F7 j2 l. P8 y7 Q1 H
running install
0 |: X' X2 n$ V) {running bdist_egg
( O' q2 T  s8 C6 z9 _9 frunning egg_info
5 {" Y( N' a4 u1 u) s7 rwriting xlrd.egg-info/PKG-INFO
. T" N* c% V, [2 }writing top-level names to xlrd.egg-info/top_level.txt
( W% X) J+ N3 g& zwriting dependency_links to xlrd.egg-info/dependency_links.txt
+ o0 [, Z5 h0 i( Greading manifest file 'xlrd.egg-info/SOURCES.txt'
! ^( e2 Y7 o/ Mreading manifest template 'MANIFEST.in'7 O3 n  _+ }$ T+ T' `
warning: no files found matching 'README.html'+ S8 P, i6 }/ |8 ]7 p
writing manifest file 'xlrd.egg-info/SOURCES.txt'
: \7 x! \' u# a8 X  ?6 Tinstalling library code to build/bdist.linux-x86_64/egg
; ?6 J4 x% [! k$ Trunning install_lib) ^  J$ R7 I4 b4 U5 U. M+ r
running build_py
* _  C. }2 O+ r0 W: Ocreating build/bdist.linux-x86_64/egg1 w% r! Z% w: M9 n
creating build/bdist.linux-x86_64/egg/xlrd! I' N1 U& u5 C7 l* P  w& j  M
creating build/bdist.linux-x86_64/egg/xlrd/doc
: g  f( Z- _) u& j$ X3 acopying build/lib/xlrd/doc/xlrd.html -> build/bdist.linux-x86_64/egg/xlrd/doc
: H, Y6 J; w) E' g  w1 Lcopying build/lib/xlrd/doc/compdoc.html -> build/bdist.linux-x86_64/egg/xlrd/doc$ e. H6 g8 ]$ t
creating build/bdist.linux-x86_64/egg/xlrd/examples5 j: {, T+ o, N& r
copying build/lib/xlrd/examples/xlrdnameAPIdemo.py -> build/bdist.linux-x86_64/egg/xlrd/examples
9 d: x- A# h: g$ }1 Kcopying build/lib/xlrd/examples/namesdemo.xls -> build/bdist.linux-x86_64/egg/xlrd/examples
! Z$ d1 ?1 U" [7 s2 t" Kcopying build/lib/xlrd/formula.py -> build/bdist.linux-x86_64/egg/xlrd
' Q5 k! X* F  lcopying build/lib/xlrd/licences.py -> build/bdist.linux-x86_64/egg/xlrd) r0 t: l) l* M8 _" H  t$ o  J2 A
copying build/lib/xlrd/formatting.py -> build/bdist.linux-x86_64/egg/xlrd  y* O3 ^( }+ I: B
copying build/lib/xlrd/timemachine.py -> build/bdist.linux-x86_64/egg/xlrd
* w% w  U; f; _# G1 E1 T% u+ n4 ^2 bcopying build/lib/xlrd/xldate.py -> build/bdist.linux-x86_64/egg/xlrd
) N/ t  n9 G" G' |# Dcopying build/lib/xlrd/sheet.py -> build/bdist.linux-x86_64/egg/xlrd# f" |+ J2 z% I
copying build/lib/xlrd/book.py -> build/bdist.linux-x86_64/egg/xlrd
) e, P# U1 d! m; _copying build/lib/xlrd/xlsx.py -> build/bdist.linux-x86_64/egg/xlrd& ^+ r1 u8 d6 @4 E. K% w: q! ~/ _
copying build/lib/xlrd/compdoc.py -> build/bdist.linux-x86_64/egg/xlrd
5 d* h% n' |" v8 ~copying build/lib/xlrd/biffh.py -> build/bdist.linux-x86_64/egg/xlrd# {) k/ ?0 i& G: n) W, [( C
copying build/lib/xlrd/__init__.py -> build/bdist.linux-x86_64/egg/xlrd2 k6 j- A2 t! M/ C; j+ `0 ?
copying build/lib/xlrd/info.py -> build/bdist.linux-x86_64/egg/xlrd5 t4 q8 w9 z3 r* O( A  f
byte-compiling build/bdist.linux-x86_64/egg/xlrd/examples/xlrdnameAPIdemo.py to xlrdnameAPIdemo.pyc" k9 T( h1 A: [  h
byte-compiling build/bdist.linux-x86_64/egg/xlrd/formula.py to formula.pyc
3 L2 K/ v: N& I) lbyte-compiling build/bdist.linux-x86_64/egg/xlrd/licences.py to licences.pyc
4 S8 ], k$ H( r! q" Sbyte-compiling build/bdist.linux-x86_64/egg/xlrd/formatting.py to formatting.pyc
3 I2 m2 g9 z$ x0 C/ C: j( n) I# wbyte-compiling build/bdist.linux-x86_64/egg/xlrd/timemachine.py to timemachine.pyc
# t: I7 n: r* k1 xbyte-compiling build/bdist.linux-x86_64/egg/xlrd/xldate.py to xldate.pyc
: S/ e$ H! i5 Wbyte-compiling build/bdist.linux-x86_64/egg/xlrd/sheet.py to sheet.pyc
+ P* @( A; c4 o3 P+ ?byte-compiling build/bdist.linux-x86_64/egg/xlrd/book.py to book.pyc: G* I) n0 [4 Q8 |
byte-compiling build/bdist.linux-x86_64/egg/xlrd/xlsx.py to xlsx.pyc0 A  m7 a9 ]) A( _) z- ~$ c% f" A
byte-compiling build/bdist.linux-x86_64/egg/xlrd/compdoc.py to compdoc.pyc1 K, M$ z3 a' R' F
byte-compiling build/bdist.linux-x86_64/egg/xlrd/biffh.py to biffh.pyc
$ F8 s5 b- @$ zbyte-compiling build/bdist.linux-x86_64/egg/xlrd/__init__.py to __init__.pyc
# h0 E% M& p# L  V' E/ l4 ^4 h  Gbyte-compiling build/bdist.linux-x86_64/egg/xlrd/info.py to info.pyc9 W" k+ R. S/ f: v" ?& R
creating build/bdist.linux-x86_64/egg/EGG-INFO/ M  Q- P* q/ o
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
+ {" ^6 ]. {, T& L2 e, rrunning install_scripts
; i& n8 p3 S) n# v5 W+ xrunning build_scripts# i4 `3 V3 i! E% U* \- [( R0 x
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts8 Z8 c1 ^( _3 M- c% P8 |& }
copying build/scripts-2.7/runxlrd.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
: U: x9 N, o+ |) T5 G  achanging mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/runxlrd.py to 755
, \5 j: L, f1 hcopying xlrd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
( H2 k( D3 y; `& @/ icopying xlrd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO# y1 `7 Y- ~( f" K4 R) T
copying xlrd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
$ G. |; @) l! F) Y- G6 Ncopying xlrd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
$ i+ j* p% t- {0 G% w3 r, `  tzip_safe flag not set; analyzing archive contents...
  ^8 X6 a5 J3 I& Cxlrd.xlsx: module references __file__
9 W1 X5 d3 L$ i6 ycreating 'dist/xlrd-1.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it- J- C1 f  K1 P0 A0 G
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
5 b# j" J% p+ J  s1 YProcessing xlrd-1.0.0-py2.7.egg' x5 }4 o# @$ J& w
removing '/usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg' (and everything under it)5 q" y/ ]  H- V! o! s
creating /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
+ M; m& l) n  F* a# SExtracting xlrd-1.0.0-py2.7.egg to /usr/lib/python2.7/site-packages4 H0 ^0 u4 m. m5 e
xlrd 1.0.0 is already the active version in easy-install.pth
9 V/ Y" v( I" A6 P$ }Installing runxlrd.py script to /usr/bin
' P% b2 b4 i1 L+ {4 X$ ]* O: v
$ X2 x% F- T/ E+ fInstalled /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg. j% F6 d4 @! o5 h. E& _; u. y
Processing dependencies for xlrd==1.0.0$ i5 {1 @, ]+ G2 ^, E
Finished processing dependencies for xlrd==1.0.0
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:33 , Processed in 0.030860 second(s), 29 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表