<div dir="ltr"><div dir="ltr"><div><br></div></div><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Feb 10, 2025 at 2:14 AM Stephen Worthington <<a href="mailto:stephen_agent@jsw.gen.nz">stephen_agent@jsw.gen.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 10 Feb 2025 00:53:31 -0600, you wrote:<br>
<br>
>Thanks Stephen,<br>
><br>
>I must have messed something up. When I run that python3 -c "import MythTV"<br>
>I get the following error:<br>
>python3 -c "import MythTV"<br>
>Traceback (most recent call last):<br>
>  File "<string>", line 1, in <module><br>
>ModuleNotFoundError: No module named 'MythTV'<br>
><br>
>However I do have the libmyth-python installed, and I reinstalled it, but<br>
>still get the error above.<br>
><br>
>When I switch to a different conda environment that I have setup for this<br>
>project, I get the same error.<br>
><br>
>in my base environment, when I cd to the /usr/lib/python3/dist-packages and<br>
>run it again I get<br>
><br>
>/usr/lib/python3/dist-packages$ python3 -c "import MythTV"<br>
>Traceback (most recent call last):<br>
>  File "<string>", line 1, in <module><br>
>  File "/usr/lib/python3/dist-packages/MythTV/__init__.py", line 38, in<br>
><module><br>
>    from .connections import dbmodule<br>
>  File "/usr/lib/python3/dist-packages/MythTV/connections.py", line 14, in<br>
><module><br>
>    import lxml.etree as etree<br>
>ModuleNotFoundError: No module named 'lxml.etree'<br>
><br>
>I tried reinstalling libmyth-python via apt, and that went fine, but<br>
>didnt change anything.<br>
><br>
>Ideas?<br>
><br>
><br>
>-- George<br>
<br>
It looks like your Python setup is bad somewhere.  Python 3 finds its<br>
packages like MythTV by searching sys.path.  So what does this show?<br>
<br>
python3 -c "import sys;print(sys.path)"<br>
<br>
On Ubuntu 24.04.1, from root I get:<br>
<br>
['', '/usr/lib/python312.zip', '/usr/lib/python3.12',<br>
'/usr/lib/python3.12/lib-dynload',<br>
'/usr/local/lib/python3.12/dist-packages',<br>
'/usr/lib/python3/dist-packages']<br>
<br>
And from my mythfrontend user I get:<br>
<br>
['', '/usr/lib/python312.zip', '/usr/lib/python3.12',<br>
'/usr/lib/python3.12/lib-dynload',<br>
'/home/stephen/.local/lib/python3.12/site-packages',<br>
'/usr/local/lib/python3.12/dist-packages',<br>
'/usr/lib/python3/dist-packages']<br>
<br>
_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org" target="_blank">mythtv-users@mythtv.org</a><br>
<a href="http://lists.mythtv.org/mailman/listinfo/mythtv-users" rel="noreferrer" target="_blank">http://lists.mythtv.org/mailman/listinfo/mythtv-users</a><br>
<a href="http://wiki.mythtv.org/Mailing_List_etiquette" rel="noreferrer" target="_blank">http://wiki.mythtv.org/Mailing_List_etiquette</a><br>
MythTV Forums: <a href="https://forum.mythtv.org" rel="noreferrer" target="_blank">https://forum.mythtv.org</a></blockquote><div><br></div><div><br></div><div>Thanks again Stephen,</div><div><br></div><div>I think I understand whats going wrong. I am using conda because of the instructions I was following, presumably to prevent this kind of problem in the first place. When using the conda environment for this project, my path does not include the python3 thats original to my machine. When I deactivate conda, I can import MythTV without error. But it wont work for my project because of the other dependencies that were all downloaded specific to the projects conda environment.</div><div><br></div><div>I'm not sure how to proceed. I don't want to start over without using conda, probably can't even without really screwing things up. But I hoped to augment this project by utilizing some of mythtvs services api. Can I simply add '/usr/lib/python3/dist-packages' to my path in the conda environment?    Note that the conda environment utilizes python 3.12, while its 3.10  natively on my machine.</div><div><br></div><div>Thanks for your help.</div><div><br></div><div><br></div><div>--George</div></div></div>