[Tutor] No module named uno in virtual environment

Jim jf_byrnes at comcast.net
Sun Sep 9 12:49:21 EDT 2018


On 09/08/2018 08:35 PM, Mats Wichmann wrote:
> On September 8, 2018 5:46:46 PM MDT, Jim <jf_byrnes at comcast.net> wrote:
>> On 09/08/2018 05:26 PM, Mats Wichmann wrote:
>>> On 09/07/2018 03:10 PM, Jim wrote:
>>>> Mint 18.1
>>>> System python3 3.5.2
>>>>
>>>> Python3-uno is available to the system python3. How can I make it
>>>> available to python 3.6.5 in a virtual environment I installed using
>> venv?
>>>
>>> with your virtualenv activated, just install it.
>>>
>>> python -m pip install uno
>>>
>>
>> My bad, I did not explain what python3-uno does. It is a system package
>>
>> that lets python interact with libreoffice. The uno that pip installs
>> is
>> a html generator.
>>
>> I used apt to install python3-uno on my system. System python3 can use
>> it and the python 3.5 in one of my virtual environments can use it.
>> Python 3.6 in my other virtual environment cannot access it.
>>
>> So to re-phrase my question. Python3-uno is installed on my system what
>>
>> do I need to do to get python 3.6 in a virtual environment to use it?
>>
>> Maybe I am missing something obvious. With all the advice given to use
>> virtual environments I would think that this problem has come up, but
>> googling did not produce a solution.
>>
>> Regards,  Jim
>>python

> 
> 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.

Regards,  Jim





More information about the Tutor mailing list