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

Python模块安装:xlrd-1.1.0

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2019-6-11 16:00:26 | 显示全部楼层 |阅读模式
1. 下载
) H% y$ z* s0 L; R2 S) L( rxlrd-1.1.0下载地址:https://pypi.org/project/xlrd/#files
! ~) ^( ]- _+ O/ d& ]! p( q1 ^2. 解压到Python包的安装目录
% H) U0 Y# I/ \' c7 r--------------------- ) e$ U! V4 A! Q5 h0 M& O

' j, S) e! a5 L6 B! \5 mcd xlrd-[color=rgb(0, 102, 102) !important]1.1.[color=rgb(0, 102, 102) !important]0
8 N; v1 x" `! s/ O6 ]  {sudo python setup.py install# I1 C. V( l6 b* L6 i( K
running install
: Q8 u0 G+ ~6 m; }) xrunning bdist_egg
6 A0 c+ M2 s2 ?1 W. a. X! |running egg_info- v  D9 ~4 n& c( Q2 |' l
writing xlrd.egg-info/PKG-INFO
- G" y% ]9 X$ ^: L, d* ewriting top-level names to xlrd.egg-info/top_level.txt
3 z5 l7 l( {7 O( W, i8 Y3 q8 C* ~writing dependency_links to xlrd.egg-info/dependency_links.txt
2 N) q+ d) M: K; Wreading manifest file 'xlrd.egg-info/SOURCES.txt'
% O$ [0 F7 f6 p. V8 D  ^% {/ greading manifest template 'MANIFEST.in'
4 c; y) K" Z$ r4 A8 o8 K. C: Ewarning: no files found matching 'README.html'
/ J) f. T5 N3 twriting manifest file 'xlrd.egg-info/SOURCES.txt'
8 N, U  F! v: _: y5 P; g4 D/ s+ c$ @installing library code to build/bdist.linux-x86_64/egg- `. \! z3 o" [( A( [8 q
running install_lib9 @6 G' A6 k7 K! E1 w+ l. Q3 u
running build_py$ A, ^1 C8 P. D! v; Y
creating build/bdist.linux-x86_64/egg
' r9 l) V+ H, B/ Wcreating build/bdist.linux-x86_64/egg/xlrd
0 g% i( n+ d/ E, w% a" N1 ^creating build/bdist.linux-x86_64/egg/xlrd/doc! `" b2 T, c4 r$ I$ ^" Z
copying build/lib/xlrd/doc/xlrd.html -> build/bdist.linux-x86_64/egg/xlrd/doc
/ m* e' }5 J- ^6 O& x- C& S- Mcopying build/lib/xlrd/doc/compdoc.html -> build/bdist.linux-x86_64/egg/xlrd/doc
. a; j' Z. Z0 k% Acreating build/bdist.linux-x86_64/egg/xlrd/examples1 L1 n: B2 _: d  w0 \3 \
copying build/lib/xlrd/examples/xlrdnameAPIdemo.py -> build/bdist.linux-x86_64/egg/xlrd/examples
+ z5 V6 v- e. G& U7 icopying build/lib/xlrd/examples/namesdemo.xls -> build/bdist.linux-x86_64/egg/xlrd/examples- B& w' b6 t3 j* S* V1 ?9 E
copying build/lib/xlrd/formula.py -> build/bdist.linux-x86_64/egg/xlrd1 E% p, z' O8 ~; ]6 U+ L+ g
copying build/lib/xlrd/licences.py -> build/bdist.linux-x86_64/egg/xlrd& J0 _- i+ N, d0 g2 e7 a
copying build/lib/xlrd/formatting.py -> build/bdist.linux-x86_64/egg/xlrd
! z& Y7 C4 O1 I/ Fcopying build/lib/xlrd/timemachine.py -> build/bdist.linux-x86_64/egg/xlrd9 c# Q4 R/ Q) B% k
copying build/lib/xlrd/xldate.py -> build/bdist.linux-x86_64/egg/xlrd3 y1 ^6 e' S. S; e3 c
copying build/lib/xlrd/sheet.py -> build/bdist.linux-x86_64/egg/xlrd
: c$ V3 g% m. Y) I" L0 vcopying build/lib/xlrd/book.py -> build/bdist.linux-x86_64/egg/xlrd, |& n; S5 {5 z3 o  g# q/ G2 N! l9 O# F
copying build/lib/xlrd/xlsx.py -> build/bdist.linux-x86_64/egg/xlrd( X# e; h, r6 d% j
copying build/lib/xlrd/compdoc.py -> build/bdist.linux-x86_64/egg/xlrd
# u/ o" T7 ^# X' _! lcopying build/lib/xlrd/biffh.py -> build/bdist.linux-x86_64/egg/xlrd8 e3 x9 L7 c; [/ r
copying build/lib/xlrd/__init__.py -> build/bdist.linux-x86_64/egg/xlrd
% [4 M5 C- ], L% T* z% p- y+ V/ wcopying build/lib/xlrd/info.py -> build/bdist.linux-x86_64/egg/xlrd
. }! I8 o5 e% n1 R2 @  |. kbyte-compiling build/bdist.linux-x86_64/egg/xlrd/examples/xlrdnameAPIdemo.py to xlrdnameAPIdemo.pyc
9 [4 m" Y0 u2 L  {& H- W& e4 Bbyte-compiling build/bdist.linux-x86_64/egg/xlrd/formula.py to formula.pyc
. g* d1 O) F% pbyte-compiling build/bdist.linux-x86_64/egg/xlrd/licences.py to licences.pyc9 O- h, r, N% U$ L, ^
byte-compiling build/bdist.linux-x86_64/egg/xlrd/formatting.py to formatting.pyc6 R) t6 i- ]" _. e5 f
byte-compiling build/bdist.linux-x86_64/egg/xlrd/timemachine.py to timemachine.pyc6 }4 h7 W8 N# W0 X5 S
byte-compiling build/bdist.linux-x86_64/egg/xlrd/xldate.py to xldate.pyc
) e# m0 Q  Q8 Dbyte-compiling build/bdist.linux-x86_64/egg/xlrd/sheet.py to sheet.pyc
. Y( F3 C5 ]  n( s+ c/ }byte-compiling build/bdist.linux-x86_64/egg/xlrd/book.py to book.pyc
9 A1 x0 y9 \( r! y5 f2 X3 x: d  ybyte-compiling build/bdist.linux-x86_64/egg/xlrd/xlsx.py to xlsx.pyc5 A$ c7 f- ~: y( `
byte-compiling build/bdist.linux-x86_64/egg/xlrd/compdoc.py to compdoc.pyc
0 [& u0 |7 L0 J& |byte-compiling build/bdist.linux-x86_64/egg/xlrd/biffh.py to biffh.pyc
3 R; @9 |1 O! o9 S$ D) Xbyte-compiling build/bdist.linux-x86_64/egg/xlrd/__init__.py to __init__.pyc
% T6 J- u( r( A% x  s( qbyte-compiling build/bdist.linux-x86_64/egg/xlrd/info.py to info.pyc( L' ], p+ e1 v5 m
creating build/bdist.linux-x86_64/egg/EGG-INFO
+ r; q# `: A  O' o4 E- vinstalling scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
) u% f- `; c; l- j! grunning install_scripts7 \. z$ ^: f% U' J- k: A2 A/ f
running build_scripts
( W3 G7 R4 b5 D+ S/ ?creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
+ r: C9 L8 J. x9 E4 f8 ]copying build/scripts-2.7/runxlrd.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
- [+ ]* L- i: Achanging mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/runxlrd.py to 755
5 l; a5 O# \+ {  M4 @copying xlrd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
/ K. @% R, d0 {, r8 m5 \, I. qcopying xlrd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
! r" n( W6 `5 Z  m" @" b7 Y2 Gcopying xlrd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO" u" P8 Y  ]  x, X$ f4 [
copying xlrd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
+ ~9 r7 b+ F1 xzip_safe flag not set; analyzing archive contents...: }2 C& W; y9 I  b6 i6 ]
xlrd.xlsx: module references __file__
, L, f  Z  ?% E0 c0 h$ Z% S' Ecreating 'dist/xlrd-1.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it' m0 f" Q$ o5 X7 L
removing 'build/bdist.linux-x86_64/egg' (and everything under it): I$ w: n0 B. x
Processing xlrd-1.0.0-py2.7.egg  }, \# U0 t. h/ h, \
removing '/usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg' (and everything under it)
( I  ^; h1 ^3 x+ A8 m$ i5 G( A- Jcreating /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg- p5 r, B9 i. c4 w- b
Extracting xlrd-1.0.0-py2.7.egg to /usr/lib/python2.7/site-packages) A1 h2 X$ N4 Y! z& }* j
xlrd 1.0.0 is already the active version in easy-install.pth
; e. I" r! [1 b, [$ y- \Installing runxlrd.py script to /usr/bin
: ]1 z0 u* P9 I+ U- D9 P% DInstalled /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg: Q+ H7 I4 }9 ^7 E( J" |9 L
Processing dependencies for xlrd==1.0.08 N: k/ @" l: a7 R6 u
Finished processing dependencies for xlrd==1.0.02 s0 Y$ S: |" ]% u& D

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-6-11 16:00:59 | 显示全部楼层
xlrd是Python中直接读取Excel文件的包:9 Y* [1 ]! {1 e, g
( D0 \7 W8 h9 H0 V0 K) m- R; o
import xlrd
" N# c8 z+ D5 f. h7 S  e
3 z& D: w5 U4 H) Bx_y_data = xlrd.open_workbook('Data.xlsx')
2 @$ m* O6 ?3 G- s: Lall_data = x_y_data.sheets()[0]
+ |, T/ w: ?5 Iall_rows = all_data.nrows #行数
: {" |& P- [+ Q1 P  n: \all_cols = all_data.ncols #列数
$ E6 v( u1 h" y! d3 Y" k( X  I0 x, e2 D: G
但是其实用pandas来读取更方便(pandas内部也需要xlrd包):
- D! J. s( Z. Y& u; e2 S$ @0 d
- P( u5 L$ n" P1 o0 t* u9 ~; O- jimport pandas as pd
# F: d" t. \. q; y2 ^. U" ?: c1 e# t! T1 {+ T
df = pd.read_excel(datafile, header=None)/ e+ L( u) p9 N# y4 j
data = df.values
% _2 i/ M8 {. t. W8 K
1 d) d" y" p& y1. 下载
+ P# ~, }3 e& P/ W4 u- H: u1 b
$ Q* G; A) b8 p( p# j# U: \1 Q" Ixlrd-1.1.0下载地址:https://pypi.org/project/xlrd/#files6 F1 k* W8 v% N2 t3 `3 E

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-7-16 14:49:39 | 显示全部楼层
python setup.py install
) h% o# C" U5 Q) k% n# O! [running install
6 B, T' a0 ?) R& {running bdist_egg' A7 e" t* N/ ^$ T
running egg_info! @; I( l7 x! T+ \" h4 `
writing xlrd.egg-info/PKG-INFO% _) h6 _2 Y) S' R- K7 d
writing top-level names to xlrd.egg-info/top_level.txt2 }" z( d( U* Z* ~% s0 P* d# ~, a4 p
writing dependency_links to xlrd.egg-info/dependency_links.txt# v. S+ G& r! N1 F! }/ I6 ~
reading manifest file 'xlrd.egg-info/SOURCES.txt'
/ z  F( m# {& n5 J2 Xreading manifest template 'MANIFEST.in'
+ `' y8 {. X; C+ Z: V: S4 Uwarning: no files found matching 'README.html'! ]6 e% F& L# k, I! q
writing manifest file 'xlrd.egg-info/SOURCES.txt'
+ J' ?# P" Z# X  Jinstalling library code to build/bdist.linux-x86_64/egg0 T. g3 {5 S+ I# y+ {: S2 l
running install_lib! |1 O% M9 N! R" K, H
running build_py
; G2 ^2 f4 o) y& N6 f$ u+ N) Ycreating build/bdist.linux-x86_64/egg7 C* w* I% Q6 G% G% }( U& R1 p
creating build/bdist.linux-x86_64/egg/xlrd! s0 D0 B8 b7 W* O4 i
creating build/bdist.linux-x86_64/egg/xlrd/doc0 I3 c3 |  E) o5 |: \8 |. c
copying build/lib/xlrd/doc/xlrd.html -> build/bdist.linux-x86_64/egg/xlrd/doc% h) s  Q+ q' o; K/ [% x. @
copying build/lib/xlrd/doc/compdoc.html -> build/bdist.linux-x86_64/egg/xlrd/doc
' C' {0 R2 r. b# _8 U* @( \creating build/bdist.linux-x86_64/egg/xlrd/examples/ Z! P0 m9 Q; c) g. [
copying build/lib/xlrd/examples/xlrdnameAPIdemo.py -> build/bdist.linux-x86_64/egg/xlrd/examples
7 @# T# c* T7 rcopying build/lib/xlrd/examples/namesdemo.xls -> build/bdist.linux-x86_64/egg/xlrd/examples+ s5 s& N7 o2 E& R
copying build/lib/xlrd/formula.py -> build/bdist.linux-x86_64/egg/xlrd
2 b: |8 e' h: y& l* }9 jcopying build/lib/xlrd/licences.py -> build/bdist.linux-x86_64/egg/xlrd
- b9 s* Z- X, A' Wcopying build/lib/xlrd/formatting.py -> build/bdist.linux-x86_64/egg/xlrd
% W! ]  c; a& x7 Pcopying build/lib/xlrd/timemachine.py -> build/bdist.linux-x86_64/egg/xlrd
# t; h1 b4 b8 o8 z( Ccopying build/lib/xlrd/xldate.py -> build/bdist.linux-x86_64/egg/xlrd
* x5 O( S# P7 o, W% acopying build/lib/xlrd/sheet.py -> build/bdist.linux-x86_64/egg/xlrd
1 M, K6 C3 Q: [# W6 v, j6 Bcopying build/lib/xlrd/book.py -> build/bdist.linux-x86_64/egg/xlrd
1 p4 A$ R6 N' O8 U: Vcopying build/lib/xlrd/xlsx.py -> build/bdist.linux-x86_64/egg/xlrd# Z& Z. t5 Q) o6 ]' w
copying build/lib/xlrd/compdoc.py -> build/bdist.linux-x86_64/egg/xlrd2 r& I# _# ^% D+ C' ?7 ?
copying build/lib/xlrd/biffh.py -> build/bdist.linux-x86_64/egg/xlrd& M! K* w8 G, |8 V& l6 X
copying build/lib/xlrd/__init__.py -> build/bdist.linux-x86_64/egg/xlrd
. d3 e0 z3 H, c1 @5 ^6 q  xcopying build/lib/xlrd/info.py -> build/bdist.linux-x86_64/egg/xlrd5 E1 c) y( e8 x1 D6 |. b7 B0 g7 G
byte-compiling build/bdist.linux-x86_64/egg/xlrd/examples/xlrdnameAPIdemo.py to xlrdnameAPIdemo.pyc' O! y: S# _5 s; u; ^0 B
byte-compiling build/bdist.linux-x86_64/egg/xlrd/formula.py to formula.pyc0 ~: E2 i) ]+ e0 Z; W8 `& z
byte-compiling build/bdist.linux-x86_64/egg/xlrd/licences.py to licences.pyc
4 s( r& ?. ?4 H. ~* j% B- j6 Sbyte-compiling build/bdist.linux-x86_64/egg/xlrd/formatting.py to formatting.pyc
9 E6 J2 @$ V6 K8 Gbyte-compiling build/bdist.linux-x86_64/egg/xlrd/timemachine.py to timemachine.pyc8 ^4 A; u1 M1 m0 |7 t7 r
byte-compiling build/bdist.linux-x86_64/egg/xlrd/xldate.py to xldate.pyc
6 n, A0 _2 L3 L. S$ M# E. cbyte-compiling build/bdist.linux-x86_64/egg/xlrd/sheet.py to sheet.pyc
! H) i, T# p$ L/ mbyte-compiling build/bdist.linux-x86_64/egg/xlrd/book.py to book.pyc
$ ]9 L/ w( g, s' Obyte-compiling build/bdist.linux-x86_64/egg/xlrd/xlsx.py to xlsx.pyc
5 O$ m+ V% W7 b& f* V- }; T* ybyte-compiling build/bdist.linux-x86_64/egg/xlrd/compdoc.py to compdoc.pyc
. @& g* @% e# m! r9 z& @byte-compiling build/bdist.linux-x86_64/egg/xlrd/biffh.py to biffh.pyc
! `2 x$ F& b/ x! nbyte-compiling build/bdist.linux-x86_64/egg/xlrd/__init__.py to __init__.pyc
! a5 T+ i9 B& lbyte-compiling build/bdist.linux-x86_64/egg/xlrd/info.py to info.pyc
4 y" I4 `/ g7 X  O; icreating build/bdist.linux-x86_64/egg/EGG-INFO: K3 y7 t) h: Q& X7 B7 G! z
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
& Y' ^2 @4 R8 P: B6 Y) k3 frunning install_scripts2 k2 X; O3 `+ S- V/ I$ O  z2 x! [
running build_scripts
& f3 X4 _: @8 F- }creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts* r$ d! R! F+ N9 P" d. u2 X6 ]
copying build/scripts-2.7/runxlrd.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts& X1 v, N* ]/ ?1 M
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/runxlrd.py to 755
0 E+ c4 r4 L: Ocopying xlrd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO+ {+ m7 ^2 N9 M6 h, g
copying xlrd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
1 Z& ?+ I5 v' I) y$ [3 _) Z. [& ^copying xlrd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
7 z0 L; l% T8 O1 `+ Pcopying xlrd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
0 f- |( D! F; a" v/ Mzip_safe flag not set; analyzing archive contents...0 ~' f1 |/ T7 l1 Z
xlrd.xlsx: module references __file__$ `1 J) l) y" z5 f8 A/ X
creating 'dist/xlrd-1.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
5 M; ]# }8 x- cremoving 'build/bdist.linux-x86_64/egg' (and everything under it)
$ b+ |0 p) p& \& f* _Processing xlrd-1.0.0-py2.7.egg2 S# f  T  ~4 W3 B. U8 c5 A. N9 @
removing '/usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg' (and everything under it)& G  u2 N% x8 P" V
creating /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
7 \/ ~/ U  F! U4 i, TExtracting xlrd-1.0.0-py2.7.egg to /usr/lib/python2.7/site-packages7 t0 Q! }4 f. D0 s( Q
xlrd 1.0.0 is already the active version in easy-install.pth
+ z  T7 V' e0 U2 a  C" w0 YInstalling runxlrd.py script to /usr/bin7 x' J. d  y1 n
, a# X# L+ E7 X4 |
Installed /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
; |& b3 }* _+ KProcessing dependencies for xlrd==1.0.0
/ O' c) s7 S- O/ gFinished processing dependencies for xlrd==1.0.0
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 01:30 , Processed in 0.029204 second(s), 28 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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