[Trac] Re: Babel installation on Trac 1.0.1

2017-08-03 Thread RjOllos


On Wednesday, August 2, 2017 at 1:38:34 PM UTC-7, Nicolas MARTIN wrote:
>
> Certainly I'm not going to discuss with you on Trac or Python related 
> topics but I only see the Babel line on system information when the babel 
> folders are in the plugins directories.
> Anyway finally this is not relevant if we need a Trac reinstallation to 
> finish Babel installation.
>
> I'm not sure if I will contact the admin about this. We can agree that the 
> most critical point for our Trac system at this moment is to upgrade and 
> not to reinstall and I will push for it.
>
> Even so, thanks for your support. I still learned a lot.
>

The location you are installing Babel may not be the python interpreter 
that your Trac installation is using. Your Trac installation could be 
installed in a virutalenv, for instance. You could inspect your webserver 
configuration to confirm. 

I did some testing, building Babel as described here:
http://babel.pocoo.org/en/latest/installation.html#living-on-the-edge

I cleaned the python environment and restarted tracd after every test.

1. First a sanity check, installed using "python setup.py install" and 
confirmed that Translations are available. I had already compiled the 
catalogs in the copy of the source.
2. Built babel using "python setup.py bdist_egg" and copied to plugins 
directory. Babel appears on system info but Translations not available. 
This doesn't surprise me because Babel is not a plugin, it's a Trac 
dependency, and the Python interpreter won't find it in the plugin 
directory when loading Trac.
3. Same issue as (2) when using a wheel in the plugin directory, but also 
Trac cannot even load a plugin from the plugin dir when it's packaged as a 
wheel, since we haven't added support for that yet (should be coming in 
Trac 1.4).
4. Did the following:
$ mkdir wheels
$ pip download babel -d wheels
$ pip install --no-cache-dir --find-links wheels babel
Collecting babel
Collecting pytz>=0a (from babel)
Installing collected packages: pytz, babel
Successfully installed babel-2.4.0 pytz-2017.2

These steps work fine, even if Trac was installed as a wheel or sdist (pip 
install --no-use-wheel trac) before installing Babel. 

However, if I install Trac from a cleaned copy of the source (python 
setup.py install) and then install Babel, Babel is shown as installed by 
"translations unavailable". This makes sense because the catalogs cannot be 
compiled without Babel. Whereas for my test in (1) I had the catalogs 
already compiled, in this case I did not. The catalogs are pre-compiled if 
installing from an sdist or wheel from PyPI.

Summary:
* Definitely don't put Babel in plugins directory
* Whether you need to reinstall Trac depends on how Trac was installed. If 
it was installed from an OS package manager you are probably fine.
* Be careful about where you are installing Babel. It needs to be installed 
in the same interpreter as Trac.

Upgrading your Trac instance and reinstalling Babel sounds like a good idea.

If you cannot upgrade or reinstall in the near future, I would investigate 
further where you are installing Babel and make sure it's the same Python 
environment that your Trac is installed in.

- Ryan

-- 
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 post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: Babel installation on Trac 1.0.1

2017-08-02 Thread Nicolas MARTIN
Certainly I'm not going to discuss with you on Trac or Python related 
topics but I only see the Babel line on system information when the 
babel folders are in the plugins directories.
Anyway finally this is not relevant if we need a Trac reinstallation to 
finish Babel installation.


I'm not sure if I will contact the admin about this. We can agree that 
the most critical point for our Trac system at this moment is to upgrade 
and not to reinstall and I will push for it.


Even so, thanks for your support. I still learned a lot.


Nicolas


On 02/08/2017 21:26, RjOllos wrote:



On Wednesday, August 2, 2017 at 12:19:06 PM UTC-7, Nicolas MARTIN wrote:

Well small improvement but the problem remains after two different
methods.

In fact, I had an easy_install binary in my config that was broken
(scraps from previous tests). After some cleaning, I got back to
the /usr/bin/easy_install and retried my initial installation of
babel from the repository. This time no runtime error but 'about'
page still complains about the translations files.

Then I followed your suggestion with wheels :

$ pip install --user --find-links wheels/ babel
Collecting babel
  Retrying (Retry(total=4, connect=None, read=None,
redirect=None)) after connection broken by

'NewConnectionError(": Failed to establish a new connection: [Errno
101] Le r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
  Retrying (Retry(total=3, connect=None, read=None,
redirect=None)) after connection broken by

'NewConnectionError(": Failed to establish a new connection: [Errno
101] Le r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
  Retrying (Retry(total=2, connect=None, read=None,
redirect=None)) after connection broken by

'NewConnectionError(": Failed to establish a new connection: [Errno
101] Le r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
  Retrying (Retry(total=1, connect=None, read=None,
redirect=None)) after connection broken by

'NewConnectionError(": Failed to establish a new connection: [Errno
101] Le r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
  Retrying (Retry(total=0, connect=None, read=None,
redirect=None)) after connection broken by

'NewConnectionError(": Failed to establish a new connection: [Errno
101] Le r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
Requirement already satisfied: pytz>=0a in
/usr/lib/python2.7/site-packages (from babel)
Installing collected packages: babel
Successfully installed babel-2.4.0

I found 2 folders in my local site-packages directory ('babel' &
'Babel-2.4.0.dist-info') and copied them to '~/trac/plugins'.
Finally I got almost the same outcome:

Babel Failed to read PKG-INFO file for Babel 2.4.0: [Errno 2] No
such file or directory:
'xx/trac/plugins/Babel-2.4.0.dist-info/PKG-INFO'
(translations unavailable)


But I'm in doubt now that my attempts are in fact useless: on
https://trac.edgewall.org/wiki/TracDownload#PreviousStableRelease
,
the prerequisites section specifies "Babel: ​1.3
 (or ​0.9.6
,
win32 installer available) needed for localizing Trac, otherwise
optional. Note that it needs to be installed *before* Trac when
installing the latter from source (.gz or .zip)."


You don't want to copy babel into the plugins directory, since it's 
not actually a plugin. It is enought to have it installed in 
site-packages. Revert that step, and you should be okay.


If translations are unavailable then you'll need to reinstall Trac now 
that Babel is installed.


- Ryan



--
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 post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: Babel installation on Trac 1.0.1

2017-08-02 Thread RjOllos


On Wednesday, August 2, 2017 at 12:19:06 PM UTC-7, Nicolas MARTIN wrote:
>
> Well small improvement but the problem remains after two different methods.
>
> In fact, I had an easy_install binary in my config that was broken (scraps 
> from previous tests). After some cleaning, I got back to the 
> /usr/bin/easy_install and retried my initial installation of babel from the 
> repository. This time no runtime error but 'about' page still complains 
> about the translations files.
>
> Then I followed your suggestion with wheels :
>
> $ pip install --user --find-links wheels/ babel
> Collecting babel
>   Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after 
> connection broken by 
> 'NewConnectionError("  
> object at 0x1efce90>: Failed to establish a new connection: [Errno 101] Le 
> r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
>   Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after 
> connection broken by 
> 'NewConnectionError("  
> object at 0x1efcbd0>: Failed to establish a new connection: [Errno 101] Le 
> r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
>   Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after 
> connection broken by 
> 'NewConnectionError("  
> object at 0x1efc990>: Failed to establish a new connection: [Errno 101] Le 
> r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
>   Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after 
> connection broken by 
> 'NewConnectionError("  
> object at 0x1e58b90>: Failed to establish a new connection: [Errno 101] Le 
> r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
>   Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after 
> connection broken by 
> 'NewConnectionError("  
> object at 0x1e58750>: Failed to establish a new connection: [Errno 101] Le 
> r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
> Requirement already satisfied: pytz>=0a in 
> /usr/lib/python2.7/site-packages (from babel)
> Installing collected packages: babel
> Successfully installed babel-2.4.0
>
> I found 2 folders in my local site-packages directory ('babel' & 
> 'Babel-2.4.0.dist-info') and copied them to '~/trac/plugins'. Finally I got 
> almost the same outcome:
>
> Babel Failed to read PKG-INFO file for Babel 2.4.0: [Errno 2] No such file 
> or directory: 'xx/trac/plugins/Babel-2.4.0.dist-info/PKG-INFO' 
> (translations unavailable)
>
>
> But I'm in doubt now that my attempts are in fact useless: on 
> https://trac.edgewall.org/wiki/TracDownload#PreviousStableRelease, the 
> prerequisites section specifies "Babel: ​1.3 
>  (or ​0.9.6 
> , 
> win32 installer available) needed for localizing Trac, otherwise optional. 
> Note that it needs to be installed *before* Trac when installing the 
> latter from source (.gz or .zip)."
>

You don't want to copy babel into the plugins directory, since it's not 
actually a plugin. It is enought to have it installed in site-packages. 
Revert that step, and you should be okay.

If translations are unavailable then you'll need to reinstall Trac now that 
Babel is installed.

- Ryan
 

-- 
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 post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: Babel installation on Trac 1.0.1

2017-08-02 Thread Nicolas MARTIN

Well small improvement but the problem remains after two different methods.

In fact, I had an easy_install binary in my config that was broken 
(scraps from previous tests). After some cleaning, I got back to the 
/usr/bin/easy_install and retried my initial installation of babel from 
the repository. This time no runtime error but 'about' page still 
complains about the translations files.


Then I followed your suggestion with wheels :

$ pip install --user --find-links wheels/ babel
Collecting babel
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) 
after connection broken by 
'NewConnectionError("object at 0x1efce90>: Failed to establish a new connection: [Errno 101] 
Le r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) 
after connection broken by 
'NewConnectionError("object at 0x1efcbd0>: Failed to establish a new connection: [Errno 101] 
Le r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) 
after connection broken by 
'NewConnectionError("object at 0x1efc990>: Failed to establish a new connection: [Errno 101] 
Le r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) 
after connection broken by 
'NewConnectionError("object at 0x1e58b90>: Failed to establish a new connection: [Errno 101] 
Le r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) 
after connection broken by 
'NewConnectionError("object at 0x1e58750>: Failed to establish a new connection: [Errno 101] 
Le r\xc3\xa9seau n'est pas accessible",)': /simple/babel/
Requirement already satisfied: pytz>=0a in 
/usr/lib/python2.7/site-packages (from babel)

Installing collected packages: babel
Successfully installed babel-2.4.0

I found 2 folders in my local site-packages directory ('babel' & 
'Babel-2.4.0.dist-info') and copied them to '~/trac/plugins'. Finally I 
got almost the same outcome:


Babel Failed to read PKG-INFO file for Babel 2.4.0: [Errno 2] No such 
file or directory: 
'xx/trac/plugins/Babel-2.4.0.dist-info/PKG-INFO' (translations 
unavailable)



But I'm in doubt now that my attempts are in fact useless: on 
https://trac.edgewall.org/wiki/TracDownload#PreviousStableRelease**, the 
prerequisites section specifies "Babel: ​1.3 
 (or ​0.9.6 
, 
win32 installer available) needed for localizing Trac, otherwise 
optional. Note that it needs to be installed *before* Trac when 
installing the latter from source (.gz or .zip)."



Nicolas


On 02/08/2017 17:57, Ryan Ollos wrote:



On Wed, Aug 2, 2017 at 8:55 AM, Nicolas MARTIN > wrote:


2.7.6 exactly and of course pip is available from the repositories
but our admin doesn't want to be involved at all in the plugins
installation activities.
So I have to manage it by myself.


If you can't get the process to work with easy_install you could grab 
the source for pip and install it.

https://pypi.python.org/pypi/pip

- Ryan


--
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 post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: Babel installation on Trac 1.0.1

2017-08-02 Thread Nicolas MARTIN
2.7.6 exactly and of course pip is available from the repositories but 
our admin doesn't want to be involved at all in the plugins installation 
activities.

So I have to manage it by myself.

On 02/08/2017 17:44, Ryan Ollos wrote:



On Wed, Aug 2, 2017 at 8:42 AM, Nicolas MARTIN > wrote:


Python 2.7.
I have done the first steps for Babel, I will try to install wheel
and finish this stuff with easy_install.


Python 2.7.9 includes pip. Do you have Python < 2.7.9?

If Python < 2.7.9, "python-pip" might be available in your OS package 
manager.


- Ryan


--
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 post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: Babel installation on Trac 1.0.1

2017-08-02 Thread Ryan Ollos
On Wed, Aug 2, 2017 at 8:42 AM, Nicolas MARTIN 
wrote:

> Python 2.7.
> I have done the first steps for Babel, I will try to install wheel and
> finish this stuff with easy_install.
>

Python 2.7.9 includes pip. Do you have Python < 2.7.9?

If Python < 2.7.9, "python-pip" might be available in your OS package
manager.

- Ryan

-- 
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 post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: Babel installation on Trac 1.0.1

2017-08-02 Thread Nicolas MARTIN

Python 2.7.
I have done the first steps for Babel, I will try to install wheel and 
finish this stuff with easy_install.


Nicolas

On 02/08/2017 17:33, Ryan Ollos wrote:



On Wed, Aug 2, 2017 at 2:08 AM, Nicolas MARTIN > wrote:


Thanks Ryan but I just realized that pip is even not installed on
the webserver... Does a similar procedure is possible with
easy_install ?


You can probably run the last step using easy_install. To install 
wheels you'll need to install the wheel package.


https://pypi.python.org/pypi/wheel

The advantage to wheels is that you can grab the Babel wheel archive 
from pypi and not build it yourself.


Which version of Python are you running?

- Ryan


--
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 post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: Babel installation on Trac 1.0.1

2017-08-02 Thread Ryan Ollos
On Wed, Aug 2, 2017 at 2:08 AM, Nicolas MARTIN 
wrote:

> Thanks Ryan but I just realized that pip is even not installed on the
> webserver... Does a similar procedure is possible with easy_install ?
>

You can probably run the last step using easy_install. To install wheels
you'll need to install the wheel package.

https://pypi.python.org/pypi/wheel

The advantage to wheels is that you can grab the Babel wheel archive from
pypi and not build it yourself.

Which version of Python are you running?

- Ryan

-- 
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 post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: Babel installation on Trac 1.0.1

2017-08-01 Thread RjOllos


On Tuesday, August 1, 2017 at 2:31:29 PM UTC-7, Nicolas MARTIN wrote:
>
> Hello Trac users, 
>
>
> After encountering several issues in plugins installation, I decided to 
> compile Babel on our project environment (not having admin rights for 
> the webserver). 
>
> As we don't have internet access from the webserver, I followed a usual 
> procedure for me: checkout the package repository on my laptop, clone it 
> via intranet to the webserver and then build on it. 
> But, with CDLR dependency, I had to checkout the right tag for the web 
> server OS and launch 'import_cldr' in order to download the 
> corresponding CDLR zip archive (here 1.3 for Babel and core-23.1.zip for 
> CLDR). 
>
> After the cloning and the archive copy to the webserver, I reiterated 
> the same command 'import_cldr' and build the data files. Finally I got 
> the egg file for Babel and copied it to ~/trac/plugins directory as usual. 
>
> But when I refreshed a Trac page on my browser, the browser loading 
> indefinitely and the log complained about missing data files: 
>
> RuntimeError: The babel data files are not available. This usually 
> happens because you are using a source checkout from Babel and you did 
> not build the data files.  Just make sure to run "python setup.py 
> import_cldr" before installing the library. 
>
> What did I do wrong ? 
>
>
> Regards, 
> Nicolas MARTIN 
>

I'm unsure what went wrong, but I'm unsure that babel should be installed 
in the plugins directory.

I can tell you a pattern that does work per my testing:

1. Download files.
$mkdir wheels
$pip download --no-cache-dir -d wheels babel
Collecting babel
  Downloading Babel-2.4.0-py2.py3-none-any.whl (6.8MB)
100% || 6.8MB 2.2MB/s
  Saved ./wheels/Babel-2.4.0-py2.py3-none-any.whl
Collecting pytz>=0a (from babel)
  Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
100% || 487kB 34.5MB/s
  Saved ./wheels/pytz-2017.2-py2.py3-none-any.whl
Successfully downloaded babel pytz 

2. Move wheels directory to the destination.

3. Install on destination.
$pip install --find-links wheels/ babel
Collecting babel
Collecting pytz>=0a (from babel)
Installing collected packages: pytz, babel
Successfully installed babel-2.4.0 pytz-2017.2

- Ryan

-- 
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 post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.