pyvjoy icon indicating copy to clipboard operation
pyvjoy copied to clipboard

Unable to load vJoy SDK DLL. Ensure that vJoyInterface.dll is present

Open CodingButter opened this issue 7 years ago • 7 comments

The code no longer is working within the _wrapper.py I've updated line 7 to dll_path = os.path.dirname(os.path.abspath(__file__)) + os.sep + dll_filename and it is working fine. Also might be a good idea to note this does not work with amd64 dll only the 32bit

CodingButter avatar Aug 30 '17 09:08 CodingButter

replace line 11 of _sdk.py with dll_path = os.path.dirname(os.path.abspath(__file__)) + os.sep + DLL_FILENAME and make sure that using 32-bit vJoyInterface.dll and make sure that you are using 32-bit python(doesn't matter that your OS is 64-bit, your python distribution needs to be 32-bit for this to work)

tg21 avatar Oct 09 '18 13:10 tg21

Is there a reason why this only works on 32bit python? I'm currently trying to use this in a project with another package that requires 64bit python.

seangtkelley avatar Oct 29 '18 03:10 seangtkelley

Is there a reason why this only works on 32bit python? I'm currently trying to use this in a project with another package that requires 64bit python.

I haven't tried this , but there shouldn't be any reason for this not to work woth 64-bit python if you are using 64-bit vjoy dll and 64-bit vjoy installion. You can try using it in 64 bit python.(only reason it may not work on 64 bit python is if developers of vjoyinterface.dll used different function in 32 bit and 64 bit files, which i think is highly unlikely). Still you can try and do tell the results.

tg21 avatar Oct 31 '18 14:10 tg21

Can't say why, but it definitely does have something to do with 64 vs 32 bit python.

If you try to import pyvjoy in 64 bit python, it throws the following OSError: %1 is not a valid Win32 application

When I changed the python interpreter for my venv to 32-bit, it fixed the error.

Antoine-BL avatar Jan 26 '19 21:01 Antoine-BL

Turns out @tg21 was right.

I got it working using python 64-bit with a 64-bit vjoy installation using the VJoyInterface.dll from the x64 folder of my vjoy installation.

Haven't had any issues, but it's always possible some could pop up.

Antoine-BL avatar Feb 24 '19 21:02 Antoine-BL

Turns out @tg21 was right.

I got it working using python 64-bit with a 64-bit vjoy installation using the VJoyInterface.dll from the x64 folder of my vjoy installation.

Haven't had any issues, but it's always possible some could pop up.

Could you explain me how to do that ?

FahrulID avatar Oct 22 '20 08:10 FahrulID

@FahrulID You have to do as follows:

  1. Install 64 bit Vjoy
  2. Go to the Vjoy's installation folder and find VJoyInterface.dll
  3. Copy that VJoyInterface.dll into the pyvjoy's folder, replacing the VJoyInterface.dll included with pyvjoy.

Antoine-BL avatar Feb 26 '21 19:02 Antoine-BL