2009-10-07 3 views
1

ctypes 사용에 문제가 있습니다. Vista에서 다음 프로젝트를 실행하려고합니다.Vista에서 ctypes로 dll을로드 할 때 액세스가 거부되었습니다.

http://sourceforge.net/projects/fractalfrost/

내가 Vista에서 이전 프로젝트를 사용하고 아무런 문제가 없었습니다. svn에서 어떤 생각이 바뀌지는 않는다는 것을 알았지 만,이 기계에 국한된 일이라고 생각하고 있습니다. 사실 나는 ctypes로 dll을로드 할 수 없습니다.

[email protected] ~/fr0st-exe/fr0st/pyflam3/win32_dlls 
$ ls 
Flam4CUDA_LIB.dll cudart.dll glew32.dll libflam3.dll pthreadVC2.dll 

[email protected] ~/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 
>>> 

어떤 아이디어가 원인일까요?

답변

2

은 나는 바보 같은 일이 같은 소리로 들리 겠지만 당신이 명시 적으로 언급하지 않았다 이후 :

당신은 당신이 액세스하려는 파일에 대한 권한을 확인 했습니까? 파일에 대한 액세스 권한을 읽거나 실행하지 않았을 수도 있습니다.

+0

그리고 정확히 그랬습니다. – null

관련 문제