On 09/09/2018 10:49 AM, Jim wrote:

>> ok, awkward naming issue. try openoffice-python instead?
>>
> 
> Unfortunately it produces the same result, no module uno found. I think
> all of the packages on pipy need the uno module to be installed to
> function.
> 
> When I installed python3-uno using apt it was installed at
> /usr/lib/python3/dist-packages/uno.py. I have python 3.5 installed in a
> virtual environment and it can load the uno module.  I have python 3.6
> installed in virtual environment and it cannot load the uno module.
> 
> Ok, I think I have solved it. Looking at the site-packages folder in the
> 3.5 virtual environment shows uno.py and unohelper.py. In the 3.6
> virtual environment they are missing. Simply putting a copy of them in
> the python3.6 site-packages folder allows me to import uno and run a
> program that depends on importing uno.
> 
> I don't know if they should have been put there when I installed the 3.6
> virtual environment or if I did something wrong when I installed it, but
> now it works.
> 
> Mats, thanks for all your help.

Glad it works, but you've left me curious now.  On a Fedora system these
two files come from libreoffice-pyuno:

/usr/lib64/python3.6/site-packages/uno.py
/usr/lib64/python3.6/site-packages/unohelper.py

and I don't presently see any way they are going to make it into a
virtualenv that is *not* set up to grab the system site-packages (that
is, created with the --system-site-packages option), I'm not finding
anything in PyPi that looks like it can provide this. The package I
mentioned above certainly doesn't.

uno.py imports the binary (shared object) pyuno module, which is fine,
that one is located wherever the {open,libre}office install puts it - on
my system just before the import it has done:

  sys.path.append('/usr/lib64/libreoffice/program')

maybe your 3.5 virtualenv was created differently than your 3.6 one and
that's why you have it there?

meanwhile, this is looking to my untrained eye like a small hole.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to