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

Python模块安装:xlrd-1.1.0

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2019-6-11 16:00:26 | 显示全部楼层 |阅读模式
1. 下载/ j6 g: f! w( I) o' q+ B
xlrd-1.1.0下载地址:https://pypi.org/project/xlrd/#files
3 w6 c+ w: I& z8 `+ I3 H2. 解压到Python包的安装目录) H4 S* Y) e7 q. b8 _4 d" `
---------------------   Q# {: `* \& T5 L7 J/ ~

3 n2 X1 ~' l1 S9 a! Tcd xlrd-[color=rgb(0, 102, 102) !important]1.1.[color=rgb(0, 102, 102) !important]05 z- u" I! Y& e* @& z$ Y
sudo python setup.py install" r+ ?4 h, j. b4 T6 h8 y
running install1 [* r( Q5 V  Y# i
running bdist_egg; O! x8 J6 Q4 W: `! d- X
running egg_info& o5 w9 U6 Z) Q2 T& r- m; {5 g
writing xlrd.egg-info/PKG-INFO
- L9 J" ?% D( D, F- }: a" E6 Pwriting top-level names to xlrd.egg-info/top_level.txt% _5 Y* h" H8 K' K; b7 S
writing dependency_links to xlrd.egg-info/dependency_links.txt
. k0 {. x' ~" F- x( `reading manifest file 'xlrd.egg-info/SOURCES.txt'
) V$ G. j) V7 E, \/ ]& @  r. Vreading manifest template 'MANIFEST.in'+ h$ v" W( f( @4 L) d
warning: no files found matching 'README.html'3 K* n. E& Y4 D* Q# H9 ^; ?0 {2 c
writing manifest file 'xlrd.egg-info/SOURCES.txt'
9 m' z- j8 ^1 l  }4 x0 T1 Minstalling library code to build/bdist.linux-x86_64/egg
4 M' f) z$ n, J4 b4 V5 M7 brunning install_lib7 k9 ?1 ?" X! i9 O
running build_py
. K/ F: H( d3 r$ x8 j& p9 Icreating build/bdist.linux-x86_64/egg  U3 i" W* w/ G$ O3 ^1 K0 t( b! A- C
creating build/bdist.linux-x86_64/egg/xlrd
  ^  o" ]; g' |creating build/bdist.linux-x86_64/egg/xlrd/doc
3 k6 }0 r- ^5 R  |copying build/lib/xlrd/doc/xlrd.html -> build/bdist.linux-x86_64/egg/xlrd/doc. D4 T0 C2 K$ K# t8 W- Z0 m; w7 f
copying build/lib/xlrd/doc/compdoc.html -> build/bdist.linux-x86_64/egg/xlrd/doc
" ~! {' h" D, P' l3 o" j7 A$ tcreating build/bdist.linux-x86_64/egg/xlrd/examples% V6 h3 ~0 w0 j' V1 ^8 \
copying build/lib/xlrd/examples/xlrdnameAPIdemo.py -> build/bdist.linux-x86_64/egg/xlrd/examples
- T& X7 N7 }" l, a1 M' @9 x. Ccopying build/lib/xlrd/examples/namesdemo.xls -> build/bdist.linux-x86_64/egg/xlrd/examples
) O: W3 a, r, qcopying build/lib/xlrd/formula.py -> build/bdist.linux-x86_64/egg/xlrd
; Z' N7 c* [" k4 Ucopying build/lib/xlrd/licences.py -> build/bdist.linux-x86_64/egg/xlrd
& K! m" V2 V& t, P/ w) n  }5 ~$ N5 @copying build/lib/xlrd/formatting.py -> build/bdist.linux-x86_64/egg/xlrd
# n+ P' H4 G, P1 O' e* `3 n5 K/ Kcopying build/lib/xlrd/timemachine.py -> build/bdist.linux-x86_64/egg/xlrd
, E" M8 Q0 C% [; v$ P8 n& \$ O9 C% s% ucopying build/lib/xlrd/xldate.py -> build/bdist.linux-x86_64/egg/xlrd
0 g7 m& B4 `* hcopying build/lib/xlrd/sheet.py -> build/bdist.linux-x86_64/egg/xlrd! J3 Y& l( c/ F; |  I
copying build/lib/xlrd/book.py -> build/bdist.linux-x86_64/egg/xlrd
* r5 F5 X+ v" u8 Z: o( q1 ocopying build/lib/xlrd/xlsx.py -> build/bdist.linux-x86_64/egg/xlrd5 G3 K8 Q* O- ^& I, b
copying build/lib/xlrd/compdoc.py -> build/bdist.linux-x86_64/egg/xlrd  O. J% o0 U1 S7 l4 k: z
copying build/lib/xlrd/biffh.py -> build/bdist.linux-x86_64/egg/xlrd
. a1 l1 s: n1 |# E6 v/ U: Kcopying build/lib/xlrd/__init__.py -> build/bdist.linux-x86_64/egg/xlrd9 d  S( e. m" w+ d5 k$ n; p
copying build/lib/xlrd/info.py -> build/bdist.linux-x86_64/egg/xlrd
! ^: N$ I" p- G. f! \0 \- d2 rbyte-compiling build/bdist.linux-x86_64/egg/xlrd/examples/xlrdnameAPIdemo.py to xlrdnameAPIdemo.pyc8 I2 ^1 S" ?  `
byte-compiling build/bdist.linux-x86_64/egg/xlrd/formula.py to formula.pyc( T% o, \2 ^" j
byte-compiling build/bdist.linux-x86_64/egg/xlrd/licences.py to licences.pyc
; k+ f5 e" S5 J# |) O. ~3 Lbyte-compiling build/bdist.linux-x86_64/egg/xlrd/formatting.py to formatting.pyc
) U1 s6 T& O, J8 k* r; Fbyte-compiling build/bdist.linux-x86_64/egg/xlrd/timemachine.py to timemachine.pyc
$ p+ l6 a9 O  a( F; d; h( kbyte-compiling build/bdist.linux-x86_64/egg/xlrd/xldate.py to xldate.pyc
$ \2 W% I9 J# P; u6 D  d9 `byte-compiling build/bdist.linux-x86_64/egg/xlrd/sheet.py to sheet.pyc) e3 k+ c1 e" C1 P9 K3 x# |
byte-compiling build/bdist.linux-x86_64/egg/xlrd/book.py to book.pyc8 M  P% |  \9 a2 H# t4 a/ E
byte-compiling build/bdist.linux-x86_64/egg/xlrd/xlsx.py to xlsx.pyc& ~$ R- o- s: _1 q7 |
byte-compiling build/bdist.linux-x86_64/egg/xlrd/compdoc.py to compdoc.pyc' X7 D/ L5 b9 s7 O' N
byte-compiling build/bdist.linux-x86_64/egg/xlrd/biffh.py to biffh.pyc: |) o- ?( R) B; c7 u1 j! [
byte-compiling build/bdist.linux-x86_64/egg/xlrd/__init__.py to __init__.pyc
  Z" S& j& \8 R' [) z0 abyte-compiling build/bdist.linux-x86_64/egg/xlrd/info.py to info.pyc
% ?: t1 {' R& l0 p3 t' X8 E4 }creating build/bdist.linux-x86_64/egg/EGG-INFO
, s* z3 f* Y# z" x# b: I- N% Xinstalling scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts& z- O' o8 s% O- }
running install_scripts# o$ H/ }/ j5 e  G8 A* V( Z% ~2 i
running build_scripts2 ?0 R: _+ X( b- _
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
: F$ M. k5 f. i* r2 Jcopying build/scripts-2.7/runxlrd.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts7 W  F6 M* @6 D
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/runxlrd.py to 7556 k- p9 p1 }) Z! d2 d
copying xlrd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO% u' d9 X( }' N3 a* c
copying xlrd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO  t2 q# N" b+ w6 v8 d5 W; ~
copying xlrd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
3 S% }3 z% Y( ^1 k) F6 O. l. m# lcopying xlrd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
, s, _: F0 p6 s/ j* ]3 @/ f( zzip_safe flag not set; analyzing archive contents...( W! r" o3 ?* W  w- T; ^
xlrd.xlsx: module references __file__' }! S" z; j+ g5 Y9 l
creating 'dist/xlrd-1.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it* }0 B  l( R' W7 f1 a" {0 p" _
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
# _7 i+ l, M& n9 \$ J8 YProcessing xlrd-1.0.0-py2.7.egg
) C5 \: p* j: ]' b3 R2 J$ m4 a4 uremoving '/usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg' (and everything under it)
) s8 g7 E) y0 u1 }; kcreating /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
  p  |: S1 J# |, v9 aExtracting xlrd-1.0.0-py2.7.egg to /usr/lib/python2.7/site-packages: K) O8 @7 U  P- @( O6 s
xlrd 1.0.0 is already the active version in easy-install.pth# c8 W( d% F" A" ~9 ]1 R2 L, A
Installing runxlrd.py script to /usr/bin1 C( k  R2 z$ N7 N: r
Installed /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
! x4 _: M- X. u. q& hProcessing dependencies for xlrd==1.0.01 m: ~: h  K) b1 C7 S* c& ~, S
Finished processing dependencies for xlrd==1.0.0
. K* q8 n, ], u# |/ e7 T

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-6-11 16:00:59 | 显示全部楼层
xlrd是Python中直接读取Excel文件的包:
6 a( \, ]* x6 J) k  P5 N
" c6 {, ?* d1 K% gimport xlrd
0 {& h' ?+ _# X& c9 ?0 }: E
% c- O: `" M0 H& s7 T, ]x_y_data = xlrd.open_workbook('Data.xlsx')
+ \. m# ^& N. _- w1 O- t- ]& {all_data = x_y_data.sheets()[0]
0 t8 m; s" p/ ^, Pall_rows = all_data.nrows #行数
8 x$ w4 ^( h. l2 l( x9 v+ j$ lall_cols = all_data.ncols #列数
3 `, D, d* H  y6 V: h; M# ], W/ ^5 j0 y6 h7 h6 M
但是其实用pandas来读取更方便(pandas内部也需要xlrd包):3 d' J# g5 R0 y6 x& M" g% g9 U0 C

1 S# V0 F& o+ U7 g! A3 Kimport pandas as pd
) f# ~: P8 b/ W! i  ^
$ d% q2 V- H% i* Mdf = pd.read_excel(datafile, header=None)
6 N' r: n+ Y4 C% F* }: tdata = df.values' v' \3 p2 _7 k

! c! e  n3 {( n8 }! x0 i1 N& i% M1. 下载3 O5 J1 v7 D9 V! G% d, }) k' M

( L" l; f$ l' u- P' xxlrd-1.1.0下载地址:https://pypi.org/project/xlrd/#files
9 l! `! r/ Y9 x: a' G

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-7-16 14:49:39 | 显示全部楼层
python setup.py install
4 z( P. _& F* o/ d! srunning install4 D" q/ p8 G2 I) H* G5 [: m3 N
running bdist_egg
. \/ A* X& v, R3 ]0 erunning egg_info
8 W" I1 Y; Y& L8 kwriting xlrd.egg-info/PKG-INFO( \6 ^; e+ A; R& |/ W4 I1 s
writing top-level names to xlrd.egg-info/top_level.txt
6 L$ b9 e1 v# Q6 k9 t( vwriting dependency_links to xlrd.egg-info/dependency_links.txt
2 s/ e* P  U1 W* ?3 |reading manifest file 'xlrd.egg-info/SOURCES.txt', F7 n7 N5 J- V- y
reading manifest template 'MANIFEST.in'5 w+ u: l1 \: t, Y
warning: no files found matching 'README.html'
' L4 X" M* K8 A2 `; |" E* y. mwriting manifest file 'xlrd.egg-info/SOURCES.txt'9 A& ?6 y& S) W3 Y
installing library code to build/bdist.linux-x86_64/egg
" O1 X6 |9 }" [, v/ }running install_lib. \) U/ q6 H8 e* @! P; ^* p
running build_py
. Q% O& ?7 q7 ^$ _creating build/bdist.linux-x86_64/egg. K3 {& D' e7 q% V
creating build/bdist.linux-x86_64/egg/xlrd  d3 U% z, t4 ~- n% Z, G/ w3 v
creating build/bdist.linux-x86_64/egg/xlrd/doc
5 D; w, o8 V2 Rcopying build/lib/xlrd/doc/xlrd.html -> build/bdist.linux-x86_64/egg/xlrd/doc
4 [8 Z* K$ z( [" ]copying build/lib/xlrd/doc/compdoc.html -> build/bdist.linux-x86_64/egg/xlrd/doc- s. d6 b' I/ c- c- o  u. j
creating build/bdist.linux-x86_64/egg/xlrd/examples- w: g* S) n$ s0 a$ g
copying build/lib/xlrd/examples/xlrdnameAPIdemo.py -> build/bdist.linux-x86_64/egg/xlrd/examples
" @- m# I) y8 f: b5 p! ccopying build/lib/xlrd/examples/namesdemo.xls -> build/bdist.linux-x86_64/egg/xlrd/examples
2 |4 A( |4 u/ Q4 @copying build/lib/xlrd/formula.py -> build/bdist.linux-x86_64/egg/xlrd9 Y* e" y( s' z5 U' D/ |7 C( L+ K8 H
copying build/lib/xlrd/licences.py -> build/bdist.linux-x86_64/egg/xlrd
. q7 y7 y1 o+ X7 r  w2 ecopying build/lib/xlrd/formatting.py -> build/bdist.linux-x86_64/egg/xlrd0 f$ s" p9 S& }
copying build/lib/xlrd/timemachine.py -> build/bdist.linux-x86_64/egg/xlrd
6 m: ^4 {5 ^! }* X0 F; N. ^' Wcopying build/lib/xlrd/xldate.py -> build/bdist.linux-x86_64/egg/xlrd+ E4 @% q. f/ p. H' Q3 J6 h
copying build/lib/xlrd/sheet.py -> build/bdist.linux-x86_64/egg/xlrd5 a8 f7 p/ E6 p' V4 `
copying build/lib/xlrd/book.py -> build/bdist.linux-x86_64/egg/xlrd  s) e5 Z2 \7 P6 s  ^$ ]
copying build/lib/xlrd/xlsx.py -> build/bdist.linux-x86_64/egg/xlrd
& B) Y8 V7 Z9 x- Gcopying build/lib/xlrd/compdoc.py -> build/bdist.linux-x86_64/egg/xlrd+ Z8 S5 b7 w! Y" F( @$ l! v$ ?
copying build/lib/xlrd/biffh.py -> build/bdist.linux-x86_64/egg/xlrd3 |6 i/ K1 a9 I$ w
copying build/lib/xlrd/__init__.py -> build/bdist.linux-x86_64/egg/xlrd
, U$ v( D' s% R' L' a& Wcopying build/lib/xlrd/info.py -> build/bdist.linux-x86_64/egg/xlrd
% e3 A8 \1 J5 ~8 w8 E* ?byte-compiling build/bdist.linux-x86_64/egg/xlrd/examples/xlrdnameAPIdemo.py to xlrdnameAPIdemo.pyc
0 L% v8 ?* {7 h2 R$ N  e8 ]. ]2 Gbyte-compiling build/bdist.linux-x86_64/egg/xlrd/formula.py to formula.pyc5 I! [0 q: b) N7 s
byte-compiling build/bdist.linux-x86_64/egg/xlrd/licences.py to licences.pyc
! U: a& F  C- Q; {; z& ybyte-compiling build/bdist.linux-x86_64/egg/xlrd/formatting.py to formatting.pyc
* M$ y! }: @$ F; B* T  hbyte-compiling build/bdist.linux-x86_64/egg/xlrd/timemachine.py to timemachine.pyc
. B, m7 ?8 D" w) ^5 S! q, Sbyte-compiling build/bdist.linux-x86_64/egg/xlrd/xldate.py to xldate.pyc
: r( i5 u* u: Z4 V+ C0 \byte-compiling build/bdist.linux-x86_64/egg/xlrd/sheet.py to sheet.pyc
, ^; E3 d7 ]* _; g: Z9 gbyte-compiling build/bdist.linux-x86_64/egg/xlrd/book.py to book.pyc
1 m" s# a. q. @byte-compiling build/bdist.linux-x86_64/egg/xlrd/xlsx.py to xlsx.pyc  E; V& p8 ^5 f6 {- m- B, w
byte-compiling build/bdist.linux-x86_64/egg/xlrd/compdoc.py to compdoc.pyc
/ U) b8 ^  A( P9 [byte-compiling build/bdist.linux-x86_64/egg/xlrd/biffh.py to biffh.pyc: s& y' f0 F% f5 `# g$ [# t: S8 @5 e
byte-compiling build/bdist.linux-x86_64/egg/xlrd/__init__.py to __init__.pyc* g$ W& F, s8 |2 o4 [
byte-compiling build/bdist.linux-x86_64/egg/xlrd/info.py to info.pyc% x' `! Y6 `2 {8 C( Z
creating build/bdist.linux-x86_64/egg/EGG-INFO) n! I7 Y) n6 B" V# r
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
! g$ z8 v+ C5 arunning install_scripts
) |+ i* W- M; c/ qrunning build_scripts. ~2 n: i" G& i8 M$ J5 k+ t- [# j& ~# l
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
- ^5 ?. j% o8 Z2 V( ccopying build/scripts-2.7/runxlrd.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
9 z  \7 n) E: P& o" R+ E6 {changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/runxlrd.py to 7559 D0 f  g( A& k; P
copying xlrd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
+ d) [4 B" `+ w. w2 E$ Ccopying xlrd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
9 ^) y: q3 J" r( q- p2 Ccopying xlrd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO! D$ o/ Z" M4 k# b6 N7 [
copying xlrd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO* C1 l7 ~9 G" ?( e& l
zip_safe flag not set; analyzing archive contents...
0 @* u# g1 o# y; D8 nxlrd.xlsx: module references __file__6 z- I4 l% f* u  E
creating 'dist/xlrd-1.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it; S- v" E  o9 T' Q: h" R
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
/ q! n) B  j2 cProcessing xlrd-1.0.0-py2.7.egg& t$ Q( @- E! g' p3 L# l& K
removing '/usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg' (and everything under it)
' R6 u" j7 S2 e! ~+ X" h8 jcreating /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg, s& a4 x" ~2 X3 H; Z  G) j
Extracting xlrd-1.0.0-py2.7.egg to /usr/lib/python2.7/site-packages
$ {' o% f1 S. B0 y) O; txlrd 1.0.0 is already the active version in easy-install.pth
3 a8 X/ ]. Q8 K4 u8 P5 @Installing runxlrd.py script to /usr/bin  x$ J6 N( \) ?6 N# F
6 n& k/ _# ~) P+ }
Installed /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
6 U' y1 g. h- {Processing dependencies for xlrd==1.0.0; G% B" e+ a1 E8 q
Finished processing dependencies for xlrd==1.0.0
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:32 , Processed in 0.028669 second(s), 29 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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