From: Wilhelm K. <ku...@t-...> - 2023-06-03 08:34:06
|
Hi Chris, I’m also using linux-gpib with Python3. To make that happen I did the following: Open a terminal and go to the folder linux-gpib-4.3.5/linux-gpib-user-4.3.5 Input: /PYTHON=/usr/bin/python3 ./configure/ The messages that will then come should include the following lines: /checking for headers required to compile python extensions... found/ and some later also: /Python binding: yes/ If this is the case then you must compile linux-gpib again. One remark: I also use Python-ivi from Alex Forencich to control gpib-devices with python, which I can highly recommend. Good success Wilhelm Am 01.06.23 um 02:56 schrieb quips_roofing.0t--- via Linux-gpib-general: > Hi Michael, > > Thanks for your response. > > Pip thinks the module is installed - > pip list |grep gpib > gpib 1.0 > > However your test code gives me an import error - > > File "testing.py", line 6, in <module> > import gpib > ModuleNotFoundError: No module named ‘gpib' > > Pip confirms the package is installed in by venv environment > > "Requirement already satisfied: gpib in > ./.venv/lib/python3.10/site-packages/gpib-1.0-py3.10-linux-x86_64.egg > (1.0)" > > Does the python import path have to be set someway to access the GPIB > install? > > Lin > Regards, > Chris > >> On 31 May 2023, at 9:31 am, Michael K via Linux-gpib-general >> <lin...@li...> wrote: >> >> What do you get when you run 'pip list' .... >> [michael@dirac ~]$ pip list |grep gpib >> gpib 1.0 >> [michael@dirac ~]$ >> >> This is an test program that works for me (without any error messages) >> >> [michael@dirac ~]$ cat GPIBtest.py >> #! /usr/bin/python3 >> ## >> # Include the GPIB extension >> ## >> import gpib >> ## >> # find & initialize the device >> ## (as defined in /etc/gpib.conf) >> device = gpib.find("hp8753c") >> ## >> # write a string to the device >> ## >> gpib.write(device,"IDN?;") >> ## >> # read a 25 byte string >> ## >> result = gpib.read(device,30) >> print ( 'Identifier is: ' + result.decode("ascii") ) >> [michael@dirac ~]$ >> >> Where hp9753c is defined in /etc/gpib.conf as .. >> device { >> minor = 0 /* minor number for interface board this >> device is connected to */ >> name = "hp8753c" /* device mnemonic */ >> pad = 16 /* The Primary Address */ >> sad = 0 /* Secondary Address */ >> >> eos = 0xa /* EOS Byte */ >> set-reos = no /* Terminate read if EOS */ >> set-bin = no /* Compare EOS 8-bit */ >> timeout = T30s /* timeout for commands */ >> } >> >> >> >> On Sunday, May 28, 2023 at 01:01:40 AM EDT, quips_roofing.0t--- via >> Linux-gpib-general <lin...@li...> wrote: >> >> >> Hi all, attempting to use python3 with linux-ppib after successfully >> using C++. >> >> >> >> _______________________________________________ >> Linux-gpib-general mailing list >> Lin...@li... >> https://lists.sourceforge.net/lists/listinfo/linux-gpib-general > > > > _______________________________________________ > Linux-gpib-general mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-gpib-general |