解决python中导入win32com.client出错的问题

yipeiwu_com7年前Python基础

准备写一个操作Excel脚本却在导入包的时候出现了一个小问题

导入包

from Tkinter import Tk
from time import sleep, ctime
from tkMessageBox import showwarning
from urllib import urlopen
import win32com.client as win32

报错提示

Traceback (most recent call last):
 File "estock.pyw", line 7, in <module>
 import win32com.client as win32
ImportError: No module named win32com.client

解决方案

python -m pip install pypiwin32

安装后

>>> import win32com.client
>>>
>>>

问题成功解决!

以上这篇解决python中导入win32com.client出错的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持【听图阁-专注于Python设计】。

相关文章

浅析python中while循环和for循环

while循环 只要循环条件为True(以下例子为x > y),while循环就会一直 执行下去: u, v, x, y = 0, 0, 100, 30 ⇽...

python如何实现内容写在图片上

python如何实现内容写在图片上

本文实例为大家分享了python将内容写在图片上的具体代码,供大家参考,具体内容如下 # -*- coding: utf-8 -*- # Created on 2018/3/20...

关于Python 3中print函数的换行详解

关于Python 3中print函数的换行详解

前言 因为工作的需要,最近看了看Python的应用,从入门级的九九乘法表开始,结果发现Python3.x和Python2.x真的是有太大的不同之处,就比如这里的换行处理,怕忘记先记下来,...

Python中%r和%s的详解及区别

Python中%r和%s的详解 %r用rper()方法处理对象 %s用str()方法处理对象 有些情况下,两者处理的结果是一样的,比如说处理int型对象。 例一: print...

python实现定时播放mp3

python实现定时播放mp3

程序很简单,主要是 mp3play 模块的应用 import mp3play, time filename = "Should It Matter.mp3" clip = mp3...