Python 在Vista上加载带有ctypes的dll时,访问被拒绝

Python 在Vista上加载带有ctypes的dll时,访问被拒绝,python,windows-vista,ctypes,Python,Windows Vista,Ctypes,我在使用ctypes时遇到问题。我正在尝试在Vista上运行以下项目 我以前在Vista上使用过这个项目,没有任何问题。我看不到svn中有任何思维改变导致这一点,我认为这是这台机器的局部问题。事实上,我根本无法加载带有CType的dll Bobby@Teresa-PC ~/fr0st-exe/fr0st/pyflam3/win32_dlls $ ls Flam4CUDA_LIB.dll cudart.dll glew32.dll libflam3.dll pthreadVC2.dll Bob

我在使用ctypes时遇到问题。我正在尝试在Vista上运行以下项目

我以前在Vista上使用过这个项目,没有任何问题。我看不到svn中有任何思维改变导致这一点,我认为这是这台机器的局部问题。事实上,我根本无法加载带有CType的dll

Bobby@Teresa-PC ~/fr0st-exe/fr0st/pyflam3/win32_dlls
$ ls
Flam4CUDA_LIB.dll cudart.dll glew32.dll libflam3.dll pthreadVC2.dll

Bobby@Teresa-PC ~/fr0st-exe/fr0st/pyflam3/win32_dlls
$ python
Python 2.6.3 (r263rc1:75186, Oct 2 2009, 20:40:30) [MSC v.1500 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> flam3_dll = CDLL('libflam3.dll')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python26\lib\ctypes\__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 5] Access is denied
>>> flam3_dll = CDLL('.\\libflam3.dll')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python26\lib\ctypes\__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 5] Access is denied
>>> import os
>>> flam3_dll = CDLL(os.path.abspath('libflam3.dll'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python26\lib\ctypes\__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 5] Access is denied
>>>
Bobby@Teresa-PC~/fr0st exe/fr0st/pyflam3/win32\u DLL
$ls
Flam4CUDA_LIB.dll cudart.dll glew32.dll libflam3.dll pthreadVC2.dll
Bobby@Teresa-PC~/fr0st exe/fr0st/pyflam3/win32\u DLL
$python
Python 2.6.3(r263rc1:751862009年10月2日20:40:30)[MSC v.1500 32位(英特尔)]
在win32上
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
>>>从ctypes导入*
>>>flam3_dll=CDLL('libflam3.dll')
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“c:\Python26\lib\ctypes\\ uuuu init\ uuuu.py”,第353行,在\uuu init中__
self.\u handle=\u dlopen(self.\u名称,模式)
WindowsError:[错误5]访问被拒绝
>>>flam3_dll=CDLL('.\\libflam3.dll')
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“c:\Python26\lib\ctypes\\ uuuu init\ uuuu.py”,第353行,在\uuu init中__
self.\u handle=\u dlopen(self.\u名称,模式)
WindowsError:[错误5]访问被拒绝
>>>导入操作系统
>>>flam3_dll=CDLL(os.path.abspath('libflam3.dll'))
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“c:\Python26\lib\ctypes\\ uuuu init\ uuuu.py”,第353行,在\uuu init中__
self.\u handle=\u dlopen(self.\u名称,模式)
WindowsError:[错误5]访问被拒绝
>>>

你知道是什么导致了这一点吗?或者更好的解决办法是什么?

我知道这听起来很愚蠢,但既然你没有明确提到这一点:

您是否检查了您试图访问的文件的权限?也许你,你知道,没有读取或执行文件的权限