Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
win32api v2to3中的更改?在PythonV3中可以很好地导入它,但在v2中会抛出一个错误_Python_Winapi_Python 2.7_Python 3.x - Fatal编程技术网

win32api v2to3中的更改?在PythonV3中可以很好地导入它,但在v2中会抛出一个错误

win32api v2to3中的更改?在PythonV3中可以很好地导入它,但在v2中会抛出一个错误,python,winapi,python-2.7,python-3.x,Python,Winapi,Python 2.7,Python 3.x,在过去的几个月里,我一直在使用Python,在3.3版中编写了一些应用程序,现在我需要编写一个只在v2中引用模块的应用程序,所以我开始使用Python 2.7.5,我在v3中编写了一个类似的应用程序,所以我想我应该从修改我在3.3到2.7.5中使用的一些代码开始 然而,我才刚刚开始,已经被难倒了。我下载了Python2.7以及pywin32 for 2.7。但是,我收到一个涉及win32api模块的导入错误,win32com.client需要该模块 这是我在3.3中使用的代码,它是有效的 fro

在过去的几个月里,我一直在使用Python,在3.3版中编写了一些应用程序,现在我需要编写一个只在v2中引用模块的应用程序,所以我开始使用Python 2.7.5,我在v3中编写了一个类似的应用程序,所以我想我应该从修改我在3.3到2.7.5中使用的一些代码开始

然而,我才刚刚开始,已经被难倒了。我下载了Python2.7以及pywin32 for 2.7。但是,我收到一个涉及win32api模块的导入错误,win32com.client需要该模块

这是我在3.3中使用的代码,它是有效的

from win32com.client import Dispatch
from adodbapi import *
from time import sleep
import os
import xml.etree.ElementTree as ET
import urllib
import string
import csv

from urllib.request import urlopen
from xml.sax.saxutils import escape
from urllib.parse import urlencode
from urllib.parse import quote
下面是2.7中的代码,它不起作用

from win32com.client import Dispatch
import adodbapi 
from time import sleep
import os
import xml.etree.ElementTree as ET
import urllib, urllib2
import string
import csv

from urllib2 import urlopen 
from xml.sax.saxutils import escape
from urllib import urlencode
from urllib import quote
我得到的具体错误是

Traceback (most recent call last):
  File "C:\Users\...", line 1, in <module>
    from win32com.client import Dispatch
  File "C:\Python27\lib\site-packages\win32com\__init__.py", line 5, in <module>
    import win32api, sys, os
ImportError: DLL load failed: The specified module could not be found.
在2.7.5中,我看到win32api确实存在,并且被PYTHONPATH发现。我可以毫无问题地导入系统和操作系统。问题肯定出在win32api上。这似乎很基本。我错过了什么

help ('modules')