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

yipeiwu_com6年前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中的lambda表达式用法详解

本文实例讲述了python中的lambda表达式用法。分享给大家供大家参考,具体如下: 这里来为大家介绍一下lambda函数。 lambda 函数是一种快速定义单行的最小函数,是从 Li...

Vue的el-scrollbar实现自定义滚动

Vue的el-scrollbar实现自定义滚动

为什么要用el-scrollbar? 最近在写一个内部平台系统,相信大家都知道,其中会有很多自定义的滚动区域,就比如说现在有一个列表需要滚动,第一个念头就是用 overflow: sc...

Python解决pip install时出现的Could not fetch URL问题

Python解决pip install时出现的Could not fetch URL问题

前言 使用python直接使用pip install xx时,出现 Could not fetch URL https://pypi.python.org/simple/requests...

使用pandas的box_plot去除异常值

我就废话不多说了,直接上代码吧! #-*- coding:utf-8 _*- """ @author:Administrator @file: standard_process....

Python any()函数的使用方法

描述: 如果iterable的任何元素为true,则返回true。如果iterable为空,则返回false。相当于: def any(iterable): for elemen...