Description
The alleged fix to #22 added a dependency on pymodbus 3.7.0 in a section with "dev" in its name, but since PyPI and pip do not care about that, this still leaves no way to install a working pymodbus with REPL from PyPI without delving deep into dependencies and bug reports.
The documentation says to pip install pymodbus[repl]
; this currently results in pymodbus 3.8.6, i.e. the situation of #22. If I do pip install pymodbus-repl
instead, I find that this does not work either because pymodbus-repl declares no dependency on (any version of) pymodbus, leaving me with a frontend to nothing.
By the way, what the documentation actually says is
Install as pymodbus optional dependency
$ pip install ".[repl]"
This may work when the cwd is in a working copy of the pymodbus repo, but certainly in no other case.
There should be a dependency on a compatible version of pymodbus here:
> pip show pymodbus-repl
Name: pymodbus_repl
Version: 2.0.4
Summary: REPL (Read-Eval-Print Loop) tool for working with Modbus devices using the Pymodbus library.
Home-page: https://github.com/pymodbus-dev/repl
Author: dhoomakethu
Author-email: otlasanju@gmail.com
License:
Location: (elided)
Requires: prompt-toolkit, pygments, tabulate, typer
Required-by:
Activity
dhoomakethu commentedon Feb 19, 2025
Refer #26, there's a lot of breaking changes in upstream pymodbus which needs to be caught up.
chrullrich commentedon Feb 19, 2025
Thank you for the quick response, but it would have been better had you taken the time to read my report first.
I am not complaining that the REPL does not work with latest pymodbus, but that it is currently very difficult to install a working combination of pymodbus-repl and pymodbus. Because pymodbus-repl does not depend on pymodbus at all, let alone "pymodbus<3.8", neither way of installing from PyPI works:
pip install pymodbus[repl]
-> pymodbus 3.8.6, pymodbus-repl 2.0.4; does not work (Cannot use the pymodbus.console because of a import error #22).pip install pymodbus-repl
-> pymodbus-repl 2.0.4, pymodbus not installed; does not work because no pymodbus.Fix: Add a dependency on
pymodbus<3.8
, or whatever the latest compatible version is, to pymodbus-repl.dhoomakethu commentedon Feb 19, 2025
Apologies for the incomplete response and the inconvenience caused, to begin with
repl
was supposed to be a utility from with in thepymodbus
code base and was not intended to be distributed independently. Later when it was decided to move it out ofpymodbus
the assumption was that it will be installed alongsidepymodbus
and should just work out of the box. That was the reason for not having the dependency defined but only thedev
dependency. Pymodbus moved really fast and a lot of helpers and aiders for repl has been removed.2.0.5
addressed thedev
part but was not released topypi
since there was a report that it does not work with 3.7.x either properly.chrullrich commentedon Feb 19, 2025
Update: The latest pymodbus version compatible with pymodbus-repl appears to be 3.7.2, and I was wrong that just adding that dependency to pymodbus-repl will sufficiently fix the problem. When
pip install pymodbus[repl]
encounters the additional dependency of pymodbus-repl to pymodbus, it will look at earlier versions of pymodbus-repl to find one that works with the pymodbus version it has (the latest one), and will happily install one that doesn't have that dependency, i.e. currently 2.0.4.Adding an exclusion to pymodbus will probably (I have not tried it) just end up with pip using an earlier version of pymodbus that doesn't have it.
The "correct" way of installing things (
pymodbus[repl]
) may not be fixable at all other than by updating pymodbus-repl to work with current pymodbus. If that was the intent of your answer, I apologize for misunderstanding.Installing
pymodbus-repl
, however, can be fixed by a new release with a dependency on a compatible pymodbus version.