Re: [Hamlib-developer] hamlib Python module
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Ervin H. <ai...@gm...> - 2023-02-05 12:38:02
|
Hi Phil, On Sun, Feb 05, 2023 at 09:29:49PM +1000, Phil wrote: > Thank you for reading this. > > I've installed hamlib 4.5.4 and everything looks fine. I have rigctl and > several other rigxxx files in /usr/local/bin and Hamlib.py is in > /usr/local/local/lib/python3.10/dist-packages/. yes, I think that's the "problem". Python3 (if you are using a distributor compiled Python) looks modules in its own path: >>> import sys >>> print(sys.path) ['', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/usr/local/lib/python3.10/dist-packages', '/usr/lib/python3/dist-packages'] which does not contain '/usr/local/local/lib/python3.10/dist-packages' directory. > It's been quite some time since I've used the hamlib Python bindings. I > created a link from Hamlib.py's location to /usr/local/lib which is in $PATH > yet "import Hamlib" fails with a "no module named Hamlib" error. > > Can someone put me out of my misery and tell me what I've forgotten? A possible workaround: >>> sys.path.append('/usr/local/lib/python3.10/site-packages') >>> import Hamlib >>> dir(Hamlib) ['Amp', 'BUILTINFUNC', 'CTCSS_LIST_SIZE' ... Hope this helps. 73, Ervin HA2OS |