Error "LoadLibrary failed with error 126: The module could not be found" when launching Spyder IDE through VPN
Asked Answered
S

3

6

Here's what happens:

  1. Using a Macbook Pro, I use the Microsoft Remote Desktop Connection application to connect to my work computer, which is a Windows 10 machine
  2. If I try to launch Spyder on my work computer, I get this error: Load Library Error

However:

  • If I am at my work computer (i.e. physically at work instead of logging in remotely), I can launch Spyder successfully
  • If I leave Spyder open on my work computer, then go home and do a remote log-in to my work computer, I can use Spyder without issue. The problem/error described above arises only if I try to open Spyder through the remote connection.
  • This error only seems to affect Spyder and I can use all other programs without issue through a remote connection. As a workaround I've been using other IDEs and successfully running scripts, but I strongly prefer Spyder.

What I have tried so far (without success):

  • The 4 troubleshooting steps posted by Fazil M. to this Microsoft thread
  • Uninstalling/reinstalling Spyder using Conda
  • Restarting my work computer

System Information:

  • Work Computer OS: Windows 10, 64-bit
  • OS of computer through which I'm logging in to work computer: Mac OS X El Capitan 10.11.6
  • Spyder version: 4.1.1

Any thoughts as to what could be going on?

Update--More information and trials:

  • I checked out Issue #3736 on Spyder's GitHub. It says to download and add a file called opengl32sw.dll to the folder ~\Lib\site-packages\PyQt5\Qt\bin. But when I go to the PyQt5 folder, I do not see a subfolder for Qt. I tried placing it into the PyQt5 main folder, but that did not fix the problem.
  • I've heard this can be a graphics card issue too. On my machine I have two graphics cards: AMD RadeonT R5 430 and Intel(R) HD Graphics 630.
Scaife answered 26/3, 2020 at 0:56 Comment(0)
F
6

Darren's answer did not work for me. What did work was to:

First option: go into the device manager and disable the Intel HD Graphics card under "display adapters."

Second option:

  1. run "Gpedit.msc"
  2. navigate to Computer Configuration->Administrative Templates->Windows Components->Remote Desktop Services->Remote Desktop Session Host->Remote Session Environment
  3. Disable "use WDDM graphics display driver for remote desktop connections"
  4. Restart the computer

See https://answers.microsoft.com/en-us/windows/forum/all/windows-10-1903-may-update-black-screen-with/23c8a740-0c79-4042-851e-9d98d0efb539

Forwardness answered 1/6, 2020 at 16:47 Comment(2)
Thanks @Noe! I just had this problem again and disabling WDDM graphics display driver fixed it.Scaife
Update! The above steps may not always work. If they don't, another thing to try is open Device Manager > Display Adapters. If there is an Intel adapter and an AMD adapter, make sure that the AMD adapter is enabled, then make sure the Intel adapter is disabled.Scaife
S
3

It took help from my organization's IT contractor, but I fixed the issue by doing the following:

  1. Run a file called "gpedit.msc", which will open up a window for Local Group Policy Editor

  2. In the tree menu on the left, navigate to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Remote Session Environment, and open the Remote Session Environment folder (not the subfolder within it)

  3. Make sure the following are set to "Enabled":

    • "Use hardware graphics adapters for all Remote Desktop Services"
    • "Prioritize H.265/AVC444 graphics mode for Remote Desktop Connections"
    • "Configure H.264/AVC hardware encoding for Remote Desktop Connections"

Then restart the computer.

Scaife answered 27/3, 2020 at 22:52 Comment(0)
A
0

Since I was unable to get pass LoadLibrary 126 error using the solutions provided online and on here, I stepped back and realized the obvious workaround. The errors occurs when you open the program while you're using a remote session, right? The obvious solution is to launch the program while a remote session is not in progress. To do this while you're remoting, you should create a batch script to launch the program but make sure to include to a time delay before that (I used 'timeout 10 /nobreak' to do so). Run the batch script and, before your program launchs, disconnect from RDP. After enough time passes for the program to launch, you can reconnect to RDP and your program will be up and ready

Arkhangelsk answered 31/8, 2021 at 23:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.