Install pymodbus without twisted

1,004 views
Skip to first unread message

yoong

unread,
Jun 18, 2012, 1:02:27 AM6/18/12
to pymo...@googlegroups.com
Hi:

  From the https://github.com/bashwork/pymodbus/blob/master/README.rst

It says that " It can also be used without any third party dependencies (aside from pyserial)"

How can I install it without twisted? I am using python3 but twisted would not be ported to python3 in the near future as far as I can see from the code.

Regards
Yoong

Galen Collins

unread,
Jun 18, 2012, 9:50:25 AM6/18/12
to pymo...@googlegroups.com

Sure,

Simply comment out thebteisted dependencies from the setup.pay before running easy install.  It should be notes that you can only use the synchronous version as twisted is the driver for the asynchronous version.

As for python3, the mainline branch has a few areas that are not py3 compatible, however the 2to3 tool should easily convert them (there is a second branch but it hasn't been updated recently).

Jean-Marc

unread,
Nov 23, 2012, 10:45:52 AM11/23/12
to pymo...@googlegroups.com
Bashwork,

I hope you can help ... I'm trying to install pymodbus for use with python 3.2.3 on Windows (sadly), and i have taken quite a bit of time reading the notes and online docs before troubling you.

I have downloaded the latest release from Git, but was unable to find the "Python 3.0 branch" that was referred to in some of the docs (that said - I'm new to Git, so I'm probably missing something :-). I only could find the master branch and gh-pages. Please let me know if I'm missing something...

I have done as you advised below and commented out the reference to twisted in setup.py - I realize that this limits me to synchronous comms, but I'm fine with that for the project. Even with this change, I'm still unsure on how to install the package, since "setup.py install" fails with a setuptools error (which is understandable, since I realize that setuptools is only 2.x compatible). Another error is also raised - basically Python3 is unhappy with the exception handling in setup.py, but I should be able to take care of that with some small compatibility changes if that's all that's needed.

I'm fairly new to Python, and very keen to get this package installed and running on Python 3. Any guidance and help would be very much appreciated!

Kind regards,

Jean-Marc

Galen Collins

unread,
Nov 23, 2012, 11:23:24 AM11/23/12
to pymo...@googlegroups.com
Okay,

I have pushed my python3 branch to github (it should appear now). A lot of the tests are failing because the python string interface has changed, but the code should be running.  Feel free to pull it down and fix anything else you see fit.  As an aside, everything should be working for python3 except the coverage module (for unit test code coverage) and twisted.

Thanks,

Galen

Jean-Marc

unread,
Nov 23, 2012, 3:16:03 PM11/23/12
to pymo...@googlegroups.com
Galen,

Many thanks! I'll give it a try.

Kind regards,

Jean-Marc

Jean-Marc

unread,
Nov 23, 2012, 3:49:17 PM11/23/12
to pymo...@googlegroups.com
Galen,

Were you able to install the package from your sources? I made the following mods to your python3 branch:
setup.py
  • Commented out 'twisted >= 12.2.0' under install_requires

ez_setup.py
  • modified line 98 to read: except pkg_resources.VersionConflict as e:
  • modified line 124 & 150: renamed urllib2 -> urllib
  • modified line 233 & 234: print(...)

The installation still fails (understandably) after attempting to download, import and install setuptools, which only supports up to v2.7.

I have done a little reading and wonder whether the distribute package may be of help? (http://pypi.python.org/pypi/distribute/0.6.30)

Failing this - is there a 'manual' way in which I can install and register this package?

Any thoughts?

JM

Doug Latornell

unread,
Nov 23, 2012, 5:11:13 PM11/23/12
to pymo...@googlegroups.com, jean.m...@gmail.com
On Fri, Nov 23, 2012 at 12:49 PM, Jean-Marc <jean.m...@gmail.com> wrote:
Galen,

Were you able to install the package from your sources? I made the following mods to your python3 branch:
setup.py
  • Commented out 'twisted >= 12.2.0' under install_requires

ez_setup.py
  • modified line 98 to read: except pkg_resources.VersionConflict as e:
  • modified line 124 & 150: renamed urllib2 -> urllib
  • modified line 233 & 234: print(...)

The installation still fails (understandably) after attempting to download, import and install setuptools, which only supports up to v2.7.

I have done a little reading and wonder whether the distribute package may be of help? (http://pypi.python.org/pypi/distribute/0.6.30)

distribute is a replacement for setup tools that works under both Python 2 and Python 3. It's what you want to use.
It is more or less API compatible with setuptools, so you should be able to install it and then do python setup.py install (or develop) in your clone of the source repo.

Jean-Marc

unread,
Nov 23, 2012, 5:26:33 PM11/23/12
to pymo...@googlegroups.com, jean.m...@gmail.com, d...@douglatornell.ca
Thanks for the feedback Doug. I figured this out after further reading. Just installed it and then pymodbus installed fine (except that it didn't seem to detect that I had already installed pyserial v2.6). I'm about to give my modbus client a first try!! :-)

Kind regards,

JM
Reply all
Reply to author
Forward
0 new messages