(Windows) Python: Failed dynamic library load, install the latest libpython3.x library

Python and python framework

Moderator: leecollings

Post Reply
NibblyPig
Posts: 13
Joined: Monday 03 August 2015 12:29
Target OS: Windows
Domoticz version:
Contact:

(Windows) Python: Failed dynamic library load, install the latest libpython3.x library

Post by NibblyPig »

Cannot for the life of me figure out how to install this.

All of the guides appear to be for linux not windows.

I am trying to get the Broadlink RM2 plugin to work.

I have installed Python 3.5.4

I have tried doing `pip install libpython` but I get `Could not find a version that satisfies the requirement libpython (from versions: )
No matching distribution found for libpython`

I have tried a few variations of the command but nothing has worked.

I've looked on google but can't find anything that looks like it's what I need.

May I have some advice/help getting this to work?
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: (Windows) Python: Failed dynamic library load, install the latest libpython3.x library

Post by zak45 »

just follow the wiki
https://www.domoticz.com/wiki/Using_Python_plugins
32 B version, check for all users, add python to path
NibblyPig
Posts: 13
Joined: Monday 03 August 2015 12:29
Target OS: Windows
Domoticz version:
Contact:

Re: (Windows) Python: Failed dynamic library load, install the latest libpython3.x library

Post by NibblyPig »

I did, but most of it is for linux.

After hours and hours I have discovered that python 3.5 does not include the libpython.

The plugin says that 3.4 isn't supported and you should use 3.5 but this is clearly wrong.

In the end I tried 3.4 and got it to appear briefly, so I added the hardware, and after that domoticz wouldn't start anymore.

It somehow corrupted it. I tried restoring the db, but same problem.

In the end I deleted domoticz completely and reinstalled it.

Now everything is back to normal except my RFXCOM transceiver is not working in domoticz. I am at my wits end having sunk hours into this already and giving up, and now I have to sink even more hours in to fix this problem.

RFXCOM manager can connect to fine to the transceiver which is on COM4. Setting the device in domoticz to COM4 seems to work fine but none of the switches work, they just say "Error sending switch command, check device/hardware !"

Of course domoticz has no useful logging of any kind so it's impossible to determine what the problem is.

So my advice is do not touch the broadlink plugin as it will ruin your day.
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: (Windows) Python: Failed dynamic library load, install the latest libpython3.x library

Post by zak45 »

NibblyPig wrote: Monday 08 April 2019 20:27 Of course domoticz has no useful logging of any kind so it's impossible to determine what the problem is.

So my advice is do not touch the broadlink plugin as it will ruin your day.
that's not true, this is the case for you but not for others:

python in windows work well and broadlink also. run on my machine since months now. Win 10 64 Bits, Python 32 Bits.
All is working when follow the wiki.
The python framework is very stable and open millions of possibility now.
And Domoticz provide enough information to help you to debug and try to found what's wrong.
NibblyPig
Posts: 13
Joined: Monday 03 August 2015 12:29
Target OS: Windows
Domoticz version:
Contact:

Re: (Windows) Python: Failed dynamic library load, install the latest libpython3.x library

Post by NibblyPig »

I spent 3 hours trying to figure out how my rfxcom was broken, domoticz wouldn't connect to it and no switches worked, rfxcom manager worked though. Nothing had changed. I could occasionally get it to send a test signal to turn a light on, but it was very unreliable.

After getting to the point where I had nothing left I could possibly think to try before reinstalling the entire computer, I decided to uninstall python, and when I did that everything immediately worked again.
Plantje
Posts: 451
Joined: Friday 16 October 2015 7:58
Target OS: Windows
Domoticz version:
Contact:

Re: (Windows) Python: Failed dynamic library load, install the latest libpython3.x library

Post by Plantje »

Here we go again... just installed the 32bit version of Python 3.9.0 and yes...
2020-10-09 21:42:29.930 Status: PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.
2020-10-09 21:42:32.938 Status: EventSystem - Python: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.

What am I doing wrong?
I have the 32 bit version... I add Python to the PATH, do a custom install for all users.
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: (Windows) Python: Failed dynamic library load, install the latest libpython3.x library

Post by Dnpwwo »

The Python Framework has not been tested against 3.9 yet and therefore Domoticz does not attempt to load it. You are a bit ahead of the curve on this.

If you build from source you could try it out by adding a line to/hardware/plugins/DelayedLink.h ~line 190. Fairly obvious what you would need to add:

Code: Select all

		if (!shared_lib_) shared_lib_ = LoadLibrary("python38.dll");
		if (!shared_lib_) shared_lib_ = LoadLibrary("python37.dll");
		if (!shared_lib_) shared_lib_ = LoadLibrary("python36.dll");
		if (!shared_lib_) shared_lib_ = LoadLibrary("python35.dll");
		if (!shared_lib_) shared_lib_ = LoadLibrary("python34.dll");
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
Plantje
Posts: 451
Joined: Friday 16 October 2015 7:58
Target OS: Windows
Domoticz version:
Contact:

Re: (Windows) Python: Failed dynamic library load, install the latest libpython3.x library

Post by Plantje »

Ah ok, that would be an option. I will try that.

On the other hand: I tried installing version 3.8.5 yesterday (that is the version I used before and that was working) However, upon installing, I am not able to tick the box to install for all users as I need "elevated rights" and this option is greyed out.
On version 3.9 this box is ticked by default so I thought it didn't matter that the box is greyed out, but it doesn't seem to work.
The strange thing is: I AM starting the installation as administrator, but still I cannot change that option.

This is the first time I am installing on Windows 10 Home. I am looking for ways to upgrade this to Windows 10 Pro as well as I am using a headless setup and this machine requires a monitor to be present in order to use Teamviewer.

Anyway, one issue at a time. I will try to add the line for the version check first :)
Plantje
Posts: 451
Joined: Friday 16 October 2015 7:58
Target OS: Windows
Domoticz version:
Contact:

Re: (Windows) Python: Failed dynamic library load, install the latest libpython3.x library

Post by Plantje »

Hmmm... installed 3.8.5 once more and now it does work
Thorgal789
Posts: 852
Joined: Wednesday 15 August 2018 14:38
Target OS: -
Domoticz version:
Contact:

Re: (Windows) Python: Failed dynamic library load, install the latest libpython3.x library

Post by Thorgal789 »

On my side I have windows 10 with domoticz and pyhon.

Code: Select all

C:\Users>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
what is your error message when using command ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest