ra1nty / DXcam

A Python high-performance screen capture library for Windows using Desktop Duplication API
MIT License
504 stars 70 forks source link

Access violation while trying to get screenshot #24

Open Katu129 opened 2 years ago

Katu129 commented 2 years ago

Hello im trying to get screenshot but i get this error

My code looks like this:

import dxcam
camera = dxcam.create()
frame = camera.grab()

Im using python 3.8.0 32bit (don't know if it matters)

Traceback (most recent call last):
  File "d:/Pulpit/Moje strony internetowe/python/keydrop/test2.py", line 1, in <module>
    import dxcam
  File "C:\Python\Python38-32\lib\site-packages\dxcam\__init__.py", line 100, in <module>
    __factory = DXFactory()
  File "C:\Python\Python38-32\lib\site-packages\dxcam\__init__.py", line 14, in __call__
    cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
  File "C:\Python\Python38-32\lib\site-packages\dxcam\__init__.py", line 26, in __init__
    p_adapters = enum_dxgi_adapters()
  File "C:\Python\Python38-32\lib\site-packages\dxcam\util\io.py", line 24, in enum_dxgi_adapters
    create_dxgi_factory(IDXGIFactory1._iid_, ctypes.byref(pfactory))
OSError: exception: access violation writing 0x4DBAF26F
AI-M-BOT commented 1 year ago

Were you using it on Windows 7?

Furimanejo commented 1 year ago

I'm getting the exact same error, running on win 10

qeWait commented 1 year ago

+, win10, python 3.9.7

Mondiegus commented 1 year ago

For everyone with this problem. The solution for me was to update Python to 3.11.4. Since that moment, everything works perfectly :)