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

Python模块安装:xlrd-1.1.0

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2019-6-11 16:00:26 | 显示全部楼层 |阅读模式
1. 下载  F: I2 d/ I2 m8 I- |
xlrd-1.1.0下载地址:https://pypi.org/project/xlrd/#files6 g; I- {, J; |" {9 P7 {) }
2. 解压到Python包的安装目录
. B( U; N. r# U0 S---------------------
  G1 N2 x7 k. ^, i. S* Q7 x, X7 d

* @/ t3 V6 {9 e/ Acd xlrd-[color=rgb(0, 102, 102) !important]1.1.[color=rgb(0, 102, 102) !important]0; L6 s' K# `" }1 Q1 a0 j+ P
sudo python setup.py install
3 Z5 ?- L* D2 n! j/ }running install
5 f( ]: j+ s, }running bdist_egg2 |! s# a7 c, j# u, Z% Z& [2 w
running egg_info! n$ ~3 X( M, m1 E  H3 v1 c
writing xlrd.egg-info/PKG-INFO
4 ]1 m- @8 S( p4 ?6 Uwriting top-level names to xlrd.egg-info/top_level.txt
# j- {8 I/ ]. L! P4 `writing dependency_links to xlrd.egg-info/dependency_links.txt
) h$ b8 L( b- Z+ qreading manifest file 'xlrd.egg-info/SOURCES.txt'
' P' |& g: |% Z" F& P6 ?3 V5 [reading manifest template 'MANIFEST.in'0 \  }+ q& I3 A9 S
warning: no files found matching 'README.html'% H9 ]6 n% t& l4 Z
writing manifest file 'xlrd.egg-info/SOURCES.txt'4 T; S. p) r- o) m+ y" I4 q, k/ _- F
installing library code to build/bdist.linux-x86_64/egg
' |7 `8 E* X/ l4 l3 m9 j. }& a) Irunning install_lib7 @5 T. I( Z6 f  D6 J. I
running build_py
% X" D" v" y7 M+ @) P+ Gcreating build/bdist.linux-x86_64/egg" M& v5 V- K$ I; {- ?
creating build/bdist.linux-x86_64/egg/xlrd9 J+ M7 R8 h' S" G1 ?" C
creating build/bdist.linux-x86_64/egg/xlrd/doc% j/ ?% ^, `3 S" n& _; i) K! p
copying build/lib/xlrd/doc/xlrd.html -> build/bdist.linux-x86_64/egg/xlrd/doc
" D3 X$ P2 ]1 m* K$ N+ R9 {copying build/lib/xlrd/doc/compdoc.html -> build/bdist.linux-x86_64/egg/xlrd/doc
, }9 i4 [8 ]" W/ C' o( Gcreating build/bdist.linux-x86_64/egg/xlrd/examples
$ u  L. u9 u, pcopying build/lib/xlrd/examples/xlrdnameAPIdemo.py -> build/bdist.linux-x86_64/egg/xlrd/examples
0 T# S- T% u& J2 Y$ p/ b0 Ucopying build/lib/xlrd/examples/namesdemo.xls -> build/bdist.linux-x86_64/egg/xlrd/examples
$ X# z* x1 H  b# i4 @8 b- Xcopying build/lib/xlrd/formula.py -> build/bdist.linux-x86_64/egg/xlrd
+ R7 R. Z1 K% c) Ncopying build/lib/xlrd/licences.py -> build/bdist.linux-x86_64/egg/xlrd2 s6 B* d8 X- c2 }1 t- V& z
copying build/lib/xlrd/formatting.py -> build/bdist.linux-x86_64/egg/xlrd* Z# D% k) t' v1 {) F3 a
copying build/lib/xlrd/timemachine.py -> build/bdist.linux-x86_64/egg/xlrd# }" `- |5 P# r2 {
copying build/lib/xlrd/xldate.py -> build/bdist.linux-x86_64/egg/xlrd
( n7 h! e5 E% w# c8 A+ Rcopying build/lib/xlrd/sheet.py -> build/bdist.linux-x86_64/egg/xlrd9 Y* ?$ p. g# C3 _
copying build/lib/xlrd/book.py -> build/bdist.linux-x86_64/egg/xlrd3 R5 e4 B$ A( y
copying build/lib/xlrd/xlsx.py -> build/bdist.linux-x86_64/egg/xlrd& K" q9 V' f: _4 L# u- M& _% }
copying build/lib/xlrd/compdoc.py -> build/bdist.linux-x86_64/egg/xlrd6 `  d3 ~& J1 T" T# [4 q+ W5 c
copying build/lib/xlrd/biffh.py -> build/bdist.linux-x86_64/egg/xlrd
$ ]2 p. f; m0 n9 G$ Scopying build/lib/xlrd/__init__.py -> build/bdist.linux-x86_64/egg/xlrd1 T, z# k% g9 @0 l. j4 y
copying build/lib/xlrd/info.py -> build/bdist.linux-x86_64/egg/xlrd) N1 Z5 h+ y: e& G% R
byte-compiling build/bdist.linux-x86_64/egg/xlrd/examples/xlrdnameAPIdemo.py to xlrdnameAPIdemo.pyc" `6 R( S1 G  B( h# V
byte-compiling build/bdist.linux-x86_64/egg/xlrd/formula.py to formula.pyc6 X) `6 N( d2 m- i2 W. ]- J
byte-compiling build/bdist.linux-x86_64/egg/xlrd/licences.py to licences.pyc
3 Z' W2 D8 q' }; kbyte-compiling build/bdist.linux-x86_64/egg/xlrd/formatting.py to formatting.pyc- M" `2 D1 C8 P* _( I9 |) u8 Q
byte-compiling build/bdist.linux-x86_64/egg/xlrd/timemachine.py to timemachine.pyc
- u3 l) A" Q. M* k* ^byte-compiling build/bdist.linux-x86_64/egg/xlrd/xldate.py to xldate.pyc
& [; a" X+ f6 p7 W& ]& h8 |3 Gbyte-compiling build/bdist.linux-x86_64/egg/xlrd/sheet.py to sheet.pyc8 u1 ~# n5 a7 l5 B' f& q' Z) h
byte-compiling build/bdist.linux-x86_64/egg/xlrd/book.py to book.pyc
5 l% o" x6 @# Q% }byte-compiling build/bdist.linux-x86_64/egg/xlrd/xlsx.py to xlsx.pyc3 \) p/ W% E+ E* r+ W3 |
byte-compiling build/bdist.linux-x86_64/egg/xlrd/compdoc.py to compdoc.pyc
8 ?# N& U# |( qbyte-compiling build/bdist.linux-x86_64/egg/xlrd/biffh.py to biffh.pyc
. h1 Q: z( B/ v0 bbyte-compiling build/bdist.linux-x86_64/egg/xlrd/__init__.py to __init__.pyc' b4 b: _9 L/ Z& ]2 X: B
byte-compiling build/bdist.linux-x86_64/egg/xlrd/info.py to info.pyc$ @& N3 o- G3 k( }6 r" B
creating build/bdist.linux-x86_64/egg/EGG-INFO( u! a, [0 ~5 a
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
3 g( d+ {( C( d9 T5 F4 }running install_scripts# o# c0 ~0 @6 u% F6 i7 f. p' H
running build_scripts
' d" z6 ^! v3 s3 L$ x' ?creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts, }" B& X) {& x: {- X$ l
copying build/scripts-2.7/runxlrd.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts$ F) \% a' v4 L5 }" |
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/runxlrd.py to 7551 F/ C% j+ }; ?7 a1 a) t4 f
copying xlrd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO6 @4 f* T8 m3 I' c% v
copying xlrd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO( A7 ]; B+ Z# k0 O
copying xlrd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
2 G& Z& _6 A2 [) J8 }copying xlrd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
1 o! L7 C$ o0 _zip_safe flag not set; analyzing archive contents...
5 n& E/ V) O* v) y' a6 {- gxlrd.xlsx: module references __file__
* g* ?/ T  L6 L# ]5 i% Icreating 'dist/xlrd-1.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
0 ?  w$ j2 T: V1 d* }removing 'build/bdist.linux-x86_64/egg' (and everything under it)  a9 _, e: A* P
Processing xlrd-1.0.0-py2.7.egg
5 _# o9 h% U0 z2 Aremoving '/usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg' (and everything under it)/ b6 z/ C$ J* X: o$ S1 r5 N$ x  [
creating /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
+ F) a/ r2 \5 t& R+ o) W6 xExtracting xlrd-1.0.0-py2.7.egg to /usr/lib/python2.7/site-packages
' A) z. ]1 c9 Gxlrd 1.0.0 is already the active version in easy-install.pth3 u; r9 O! J/ E; r* q
Installing runxlrd.py script to /usr/bin
- K: z. {. m* t, iInstalled /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg
: }: N/ k6 v8 q8 dProcessing dependencies for xlrd==1.0.06 V& m7 f# M% N- M+ Q" K9 A
Finished processing dependencies for xlrd==1.0.0
. C8 a$ ?4 ^. d

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-6-11 16:00:59 | 显示全部楼层
xlrd是Python中直接读取Excel文件的包:
, d" e# l( J: w8 C1 @5 b" }' L% e) u7 q1 }( ?4 F! C' R
import xlrd  G$ k- E* Z( v

4 n0 v( X: j& V, }x_y_data = xlrd.open_workbook('Data.xlsx')
/ O9 H5 U  @# S4 D3 y7 @) P  m5 Lall_data = x_y_data.sheets()[0]* }  f( F1 f/ x7 U2 b) L
all_rows = all_data.nrows #行数4 \& L! F( @3 l& g' s( U
all_cols = all_data.ncols #列数' g% E, `$ r/ {; Y5 G
8 e: w& y* J; c& G
但是其实用pandas来读取更方便(pandas内部也需要xlrd包):% e8 p) |/ _4 l3 B
6 M# }$ C; v& U2 B( O
import pandas as pd/ z( T  [. n1 X" n% u7 ^
+ I) l' f* Y  I6 b5 P5 N
df = pd.read_excel(datafile, header=None)
8 C6 v) H$ q5 B5 Y# Cdata = df.values* x/ r5 q# E' Y' o9 g  Z

5 d3 g  y+ P5 O8 Z5 e1. 下载' Q" I" V2 F7 x- D

7 N1 D  t$ O( \0 |. Xxlrd-1.1.0下载地址:https://pypi.org/project/xlrd/#files
% F$ T6 v0 W$ ]9 k- Z

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-7-16 14:49:39 | 显示全部楼层
python setup.py install$ G0 c. h) |' s* `$ B+ ]2 N! G
running install
- W% B1 K% ?, M8 W2 u2 R, Krunning bdist_egg
; o1 ]- u& Y( g2 O3 U' Wrunning egg_info
' e5 r  E2 l6 [) a7 uwriting xlrd.egg-info/PKG-INFO' U0 u2 w" f+ q, l2 S, I
writing top-level names to xlrd.egg-info/top_level.txt
9 C! Q4 P( E* k0 u: ?writing dependency_links to xlrd.egg-info/dependency_links.txt. J6 d+ C9 K5 C# H' [4 M. o
reading manifest file 'xlrd.egg-info/SOURCES.txt'5 M, o# j" ~8 |1 B9 `0 H
reading manifest template 'MANIFEST.in'( o/ P' t7 v8 c& [+ |( w+ Z
warning: no files found matching 'README.html'
8 }" D$ l, f6 b  U5 \" nwriting manifest file 'xlrd.egg-info/SOURCES.txt'" ~) n* s- q6 a" B! v9 p- R* m
installing library code to build/bdist.linux-x86_64/egg
9 F% P" @7 L: R5 z3 g3 _9 ~& @5 B  trunning install_lib
# ?( [1 C% ~' ^+ Hrunning build_py
* J/ F$ D: ?7 U7 J/ [: m' ~creating build/bdist.linux-x86_64/egg" O+ X9 e  g( }' R* d; Z1 _) L
creating build/bdist.linux-x86_64/egg/xlrd
6 i# j- K) Q/ bcreating build/bdist.linux-x86_64/egg/xlrd/doc
0 H' U! M0 t4 E$ `5 \8 Pcopying build/lib/xlrd/doc/xlrd.html -> build/bdist.linux-x86_64/egg/xlrd/doc9 [8 l# j, T7 O$ ]  r5 B
copying build/lib/xlrd/doc/compdoc.html -> build/bdist.linux-x86_64/egg/xlrd/doc" ^: a) ~0 e9 g
creating build/bdist.linux-x86_64/egg/xlrd/examples
8 y, m" R+ h7 b2 Scopying build/lib/xlrd/examples/xlrdnameAPIdemo.py -> build/bdist.linux-x86_64/egg/xlrd/examples$ o" Z$ w" s! P, t$ b* i4 Q  w: X$ w
copying build/lib/xlrd/examples/namesdemo.xls -> build/bdist.linux-x86_64/egg/xlrd/examples7 Y/ @4 o$ {+ F1 s$ q1 b
copying build/lib/xlrd/formula.py -> build/bdist.linux-x86_64/egg/xlrd
: ?" O, H+ i6 R2 ~) ]/ xcopying build/lib/xlrd/licences.py -> build/bdist.linux-x86_64/egg/xlrd0 j, k+ C8 a3 z6 Q2 J0 ]
copying build/lib/xlrd/formatting.py -> build/bdist.linux-x86_64/egg/xlrd
: S& r2 n- F) A# Tcopying build/lib/xlrd/timemachine.py -> build/bdist.linux-x86_64/egg/xlrd' I1 i5 T1 z) T/ o; n( R
copying build/lib/xlrd/xldate.py -> build/bdist.linux-x86_64/egg/xlrd1 S: U) B- B. p# T
copying build/lib/xlrd/sheet.py -> build/bdist.linux-x86_64/egg/xlrd1 C, X3 P, b! U8 [# U& }' g
copying build/lib/xlrd/book.py -> build/bdist.linux-x86_64/egg/xlrd
3 Y; Y4 D; N9 q" L: \' B! Lcopying build/lib/xlrd/xlsx.py -> build/bdist.linux-x86_64/egg/xlrd
! t( }. H3 c, h  ?copying build/lib/xlrd/compdoc.py -> build/bdist.linux-x86_64/egg/xlrd3 X2 _; T) Y& K9 X2 v" m6 N: n* g
copying build/lib/xlrd/biffh.py -> build/bdist.linux-x86_64/egg/xlrd
5 e- E* G1 i( H/ y4 |* k# V$ Dcopying build/lib/xlrd/__init__.py -> build/bdist.linux-x86_64/egg/xlrd) R0 J5 j1 L9 P
copying build/lib/xlrd/info.py -> build/bdist.linux-x86_64/egg/xlrd3 P2 W, j/ f) {3 f) v
byte-compiling build/bdist.linux-x86_64/egg/xlrd/examples/xlrdnameAPIdemo.py to xlrdnameAPIdemo.pyc
8 G/ {: y2 \1 lbyte-compiling build/bdist.linux-x86_64/egg/xlrd/formula.py to formula.pyc
6 {2 o6 x) c9 R& Qbyte-compiling build/bdist.linux-x86_64/egg/xlrd/licences.py to licences.pyc4 R& _$ |8 e  `. G- T) Z6 l
byte-compiling build/bdist.linux-x86_64/egg/xlrd/formatting.py to formatting.pyc
  z, ~. A( @' G: Zbyte-compiling build/bdist.linux-x86_64/egg/xlrd/timemachine.py to timemachine.pyc3 W% h& d4 M# S/ N3 j
byte-compiling build/bdist.linux-x86_64/egg/xlrd/xldate.py to xldate.pyc- r  w2 x- Q, a
byte-compiling build/bdist.linux-x86_64/egg/xlrd/sheet.py to sheet.pyc
. o3 R. g* e( s, y# v/ cbyte-compiling build/bdist.linux-x86_64/egg/xlrd/book.py to book.pyc4 Y# ~4 [2 D( L
byte-compiling build/bdist.linux-x86_64/egg/xlrd/xlsx.py to xlsx.pyc, B" O. |4 ?  b/ T4 Y; G8 d
byte-compiling build/bdist.linux-x86_64/egg/xlrd/compdoc.py to compdoc.pyc
5 E. Z! }- [1 m* C) N" @byte-compiling build/bdist.linux-x86_64/egg/xlrd/biffh.py to biffh.pyc
7 Y$ r: G4 K4 y$ I+ W3 t8 Kbyte-compiling build/bdist.linux-x86_64/egg/xlrd/__init__.py to __init__.pyc
, s4 S$ m: y8 g% b5 ~6 g+ Obyte-compiling build/bdist.linux-x86_64/egg/xlrd/info.py to info.pyc. K; t  K& P% i
creating build/bdist.linux-x86_64/egg/EGG-INFO! o' j+ L. f! [: |; e7 B6 y
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts( ]# f/ o1 @. n
running install_scripts
4 c* r( V: p" Vrunning build_scripts0 W8 U/ d) j. H" h
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts. c2 o, Q, R; B: j3 `# J
copying build/scripts-2.7/runxlrd.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts8 ^8 e2 [# k7 d9 U) z; l
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/runxlrd.py to 7552 H0 ^" F5 a6 x( M; w
copying xlrd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
, u$ |& B% O. L. C- ecopying xlrd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO; ]+ L1 Y7 W! f; x5 V# m- T  f
copying xlrd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
6 h6 @) _- n7 y. Ocopying xlrd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO3 H* ?  A) ?  ~0 w7 }
zip_safe flag not set; analyzing archive contents...' b; r. ~# @" p0 Y3 f, `& n4 I
xlrd.xlsx: module references __file__
3 B9 f: a$ {4 \creating 'dist/xlrd-1.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it8 L# O( Y: @3 }$ Y! d2 z
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
( p4 v2 M" M* q2 O( hProcessing xlrd-1.0.0-py2.7.egg
8 q* [- u& N% C2 dremoving '/usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg' (and everything under it)# {; o, b5 ^) J3 U
creating /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg! R8 I6 v+ b7 Y. i
Extracting xlrd-1.0.0-py2.7.egg to /usr/lib/python2.7/site-packages
& i, m) D  G" `/ O& i% a7 nxlrd 1.0.0 is already the active version in easy-install.pth* g% ~) }5 W5 H1 G
Installing runxlrd.py script to /usr/bin
. o' G4 {6 J6 K' N7 ~3 }9 k* B4 q; k8 G. o
Installed /usr/lib/python2.7/site-packages/xlrd-1.0.0-py2.7.egg+ Z, Z0 |0 O2 b) d8 l+ o! R) _
Processing dependencies for xlrd==1.0.0/ ?) y9 u% X' ^7 X
Finished processing dependencies for xlrd==1.0.0
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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