Re: [Trac] How to install local python libraries in users home?

2019-11-12 Thread Mo
Am Dienstag, 12. November 2019 11:46:28 UTC+1 schrieb Mo:
>
>
> How do I make uwsgi find the local python libraries such as 
> ~/.local/lib64/python2.7/site-packages ?
>

I got it solved by adding this line to the uwsgi ini file:

pythonpath = /mnt/data/trac/.local/lib64/python2.7/site-packages


-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/11c73f21-0a03-487d-aed8-f0720e920b34%40googlegroups.com.


Re: [Trac] How to install local python libraries in users home?

2019-11-12 Thread Mo
Am Freitag, 8. November 2019 11:09:32 UTC+1 schrieb Jun Omae:

>
> Have you added the path to configuration of your web server? 
> Please share the configuration here if unable to solve it. 
>

How do I make uwsgi find the local python libraries such as 
~/.local/lib64/python2.7/site-packages ?
My uwsgi.ini looks like:

# cat /etc/uwsgi.d/trac-pp.ini

[uwsgi]
plugins = python27
chown-socket = trac:nginx
uid = trac
gid = trac
workers = 6
socket = /run/uwsgi/%n.sock

env = TRAC_ENV=/mnt/data/trac/projects/trac-pp
env = PYTHON_EGG_CACHE=/mnt/data/trac/.python-eggs
module = trac.web.main
callable = dispatch_request

It starts that some more plugins need external python libraries, like 
SqlQueryMacro needs pymills and TracWikiPrintPlugin needs xhtml2pdf.

Beside that, the maintained alternative for SqlQueryMacro is 
SqlAlchemyQueryMacro which I also fail to install as the installation 
procedure is completely different:
https://trac-hacks.org/ticket/13644

And to complete the list of failures, the next alternative I tried is 
TracSQL and also failing with its installation procedure: 
https://github.com/trac-hacks/tracsql/issues/4

Any idea?
Best regards.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/6e158ddf-4db4-41fa-b993-4c1b8d06a5e6%40googlegroups.com.


Re: [Trac] How to install local python libraries in users home?

2019-11-08 Thread Jun Omae
On Fri, Nov 8, 2019 at 6:03 PM Mo  wrote:
> I found there is also pip2.7 and I did:
>
> pip2.7 install --user xhtml2pdf
>
> Now I have:
> $ tree ~trac/.local/lib64/ -L 3
> /mnt/data/trac/.local/lib64/
> ├── python2.7
> │   └── site-packages
> │   ├── PIL
> │   ├── Pillow-6.2.1.dist-info
> │   ├── PyPDF2
> │   ├── PyPDF2-1.26.0-py2.7.egg-info
> │   ├── reportlab
> │   ├── reportlab-3.5.32.dist-info
> │   ├── xhtml2pdf
> │   └── xhtml2pdf-0.2.3-py2.7.egg-info
> └── python3.6

Have you added the path to configuration of your web server?
Please share the configuration here if unable to solve it.


-- 
Jun Omae  (大前 潤)

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CAEVLMagOJzREi5RvCTMDKH0TxCcB2uGP45dkJSEuF69EKcTGhw%40mail.gmail.com.


Re: [Trac] How to install local python libraries in users home?

2019-11-08 Thread Mo
Am Donnerstag, 7. November 2019 14:09:12 UTC+1 schrieb Jun Omae:

> Cannot. Your system installed pip is targeted to Python 3.6. The pip 
> must be installed as targeted to Python 2.7. 
> I recommend to use virtualenv with Python 2.7 rather than using system 
> installed pip. 
>
> See https://wiki.gentoo.org/wiki/Project:Python/PYTHON_TARGETS 
>

I already had:
 
 [I] dev-python/pip
 Available versions:  9.0.1-r1^t (~)9.0.1-r2^t 19.1^t (~)19.3.1^t {test 
-vanilla PYTHON_TARGETS="pypy pypy3 python2_7 python3_5 python3_6 python3_7"
}
 Installed versions:  19.3.1^t(15:38:09 05.11.2019)(-test -vanilla 
PYTHON_TARGETS="python2_7 python3_6 -pypy -pypy3 -python3_5 -python3_7")

I found there is also pip2.7 and I did:

pip2.7 install --user xhtml2pdf

Now I have:
$ tree ~trac/.local/lib64/ -L 3
/mnt/data/trac/.local/lib64/
├── python2.7
│   └── site-packages
│   ├── PIL
│   ├── Pillow-6.2.1.dist-info
│   ├── PyPDF2
│   ├── PyPDF2-1.26.0-py2.7.egg-info
│   ├── reportlab
│   ├── reportlab-3.5.32.dist-info
│   ├── xhtml2pdf
│   └── xhtml2pdf-0.2.3-py2.7.egg-info
└── python3.6
└── site-packages
├── PIL
├── Pillow-6.2.1.dist-info
├── PyPDF2
├── PyPDF2-1.26.0-py3.6.egg-info
├── reportlab
├── reportlab-3.5.32.dist-info
├── xhtml2pdf
└── xhtml2pdf-0.2.3-py3.6.egg-info

But even after restarting the uwsgi I get: 'xhtml2pdf' distribution was not 
found

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/97444350-f94e-43a1-bc9c-22db49657743%40googlegroups.com.


Re: [Trac] How to install local python libraries in users home?

2019-11-07 Thread Jun Omae
On Thu, Nov 7, 2019 at 9:40 PM Mo  wrote:
>
> Hi,
>
> as mentioned in https://trac-hacks.org/ticket/13640 some Python libraries are 
> not available by the Linux distribution, so I like to install them separately 
> by pip.
> How can I install for instance xhtml2pdf locally for the trac home in ~trac/ ?
>
> I tried by
>
>  pip install --user xhtml2pdf
>
> and got
>
> $ tree ~trac/.local/lib64/ -L 3
> /mnt/data/trac/.local/lib64/
> └── python3.6
> └── site-packages
> ...

Cannot. Your system installed pip is targeted to Python 3.6. The pip
must be installed as targeted to Python 2.7.
I recommend to use virtualenv with Python 2.7 rather than using system
installed pip.

See https://wiki.gentoo.org/wiki/Project:Python/PYTHON_TARGETS

-- 
Jun Omae  (大前 潤)

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CAEVLMahSAvHvA6vypEWfm86cHEqU3%2B3mSTfGxRLBWPG40M7AMw%40mail.gmail.com.


[Trac] How to install local python libraries in users home?

2019-11-07 Thread Mo
Hi,

as mentioned in https://trac-hacks.org/ticket/13640 some Python libraries 
are not available by the Linux distribution, so I like to install them 
separately by pip.
How can I install for instance xhtml2pdf locally for the trac home in 
~trac/ ?

I tried by 

 pip install --user xhtml2pdf

and got 

$ tree ~trac/.local/lib64/ -L 3
/mnt/data/trac/.local/lib64/
└── python3.6
└── site-packages
├── PIL
├── Pillow-6.2.1.dist-info
├── PyPDF2
├── PyPDF2-1.26.0-py3.6.egg-info
├── reportlab
├── reportlab-3.5.32.dist-info
├── xhtml2pdf
└── xhtml2pdf-0.2.3-py3.6.egg-info

But Trac still fails like this:

2019-11-06 11:22:22,359 Trac[loader] DEBUG: Skipping "TracWikiPrintPlugin 
2.0.0.dev0": DistributionNotFound: The 'xhtml2pdf' distribution was not found 
and is required by TracWikiPrintPlugin

The uwsgi workers are running as user trac and should be able to find the 
python library at $HOME.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/b64a5ce6-59fd-48db-9090-70b7c94d8820%40googlegroups.com.