Installing the XMLRPC plugin on DreamHost (virtual python environment)

69 views
Skip to first unread message

Kamil Libich

unread,
Mar 7, 2012, 1:15:19 PM3/7/12
to trac-...@googlegroups.com
Hi,

The Scenario:

Trac version 11.4

The aim: to connect to the trac from iPad thru tracViewer app.

The tool: the XMLRPC trac plugin has to be installed on the server side.

The problem: how to install the XMLRPC on the server.

The things done:
1. virtual python environment has been installed succesfully (in $HOME/env)

The show stopper: the variable $PYTHONPATH. To what it shall be set to?

The unknown: how this virtual python environment works and what I shall to do to install the plugin

The error message of the showstopper:

=================================================================================
[BAT]$ which easy_install
/usr/bin/easy_install

[BAT]$ source env/bin/activate
(env)[terranova]$ which easy_install
/home/kik/env/bin/easy_install

(env)[BAT]$ easy_install --install-dir=$PYTHONPATH http://trac-hacks.org/svn/xmlrpcplugin 0.10 # 0.10
TEST FAILED:  does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:



and your PYTHONPATH environment variable currently contains:

    ''

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:


Please make the appropriate changes for your system and try again.
=======================================================================================

Please help.

Kamil


Kamil Libich

unread,
Mar 7, 2012, 5:15:10 PM3/7/12
to trac-...@googlegroups.com

osimons

unread,
Mar 12, 2012, 4:37:36 AM3/12/12
to trac-...@googlegroups.com


onsdag 7. mars 2012 kl. 19:15:19 UTC+1 skrev Kamil følgende:
The Scenario:

Trac version 11.4

The aim: to connect to the trac from iPad thru tracViewer app.

The tool: the XMLRPC trac plugin has to be installed on the server side.

The problem: how to install the XMLRPC on the server.

The things done:
1. virtual python environment has been installed succesfully (in $HOME/env)

[snip] 

(env)[BAT]$ easy_install --install-dir=$PYTHONPATH http://trac-hacks.org/svn/xmlrpcplugin 0.10 # 0.10
TEST FAILED:  does NOT support .pth files
error: bad install directory or PYTHONPATH


You want the 0.11 (= trunk) version for Trac 0.11.4 (for anything 0.11+). The version for Trac 0.10.x will no longer work for your more recent version. It should look something like:


...which is the URL copied from the plugin documentation that you don't seem to be following? Check this:



:::simon

Kamil Libich

unread,
Mar 12, 2012, 6:46:03 AM3/12/12
to trac-...@googlegroups.com
Thanks Simon,

Maybe really this is a part of the problem. However, I think the main problem is on the PYTHON/PYTHON virtual environment border.

The installation command I'm issuing comes from my hosting company:  
http://wiki.dreamhost.com/Trac#Plugins 

However they are not supporting neither the trac nor Python, so I don't have the support of them.

My questions:
1. What is that PYTHONPATH variable? To which value it has to be switch set?
2. What is that source /path/to/env/bin/activate command for?
3. If I install this in my Python/Trac environment will the plugin be available to all my trac sites automatically?
4. Where to observe the log if any?

Cheers,

Kamil


--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/uJUPUJCBqUQJ.
To post to this group, send email to trac-...@googlegroups.com.
To unsubscribe from this group, send email to trac-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.

osimons

unread,
Mar 12, 2012, 12:10:00 PM3/12/12
to trac-...@googlegroups.com

On Monday, March 12, 2012 11:46:03 AM UTC+1, Kamil wrote:My questions:
1. What is that PYTHONPATH variable? To which value it has to be switch set?

If you have virtualenv installed, and have activated it (either by "activate" or by running configured scripts directly like "/path/to/env/bin/easy_install") all environment settings should be prepared for you. You should just use the defaults for the virtualenv and don't need additional paths, so really just ignore it. The modules you install for the virtualenv will end up in /path/to/env/lib/python2.x/site-packages/ which is just fine, and don't use additional configuration or command-line switches when installing.
 
2. What is that source /path/to/env/bin/activate command for?

See 1. It basically switches your shell to environment variables prepared for the virtualenv you activate. So that you run the correct scripts, install to correct locations etc. You may want to read through the virtualenv docs and make sure you understand what virtualenv is (and isn't): http://pypi.python.org/pypi/virtualenv
 
3. If I install this in my Python/Trac environment will the plugin be available to all my trac sites automatically?

Yes, it will be a "global" install - for all trac processes that originate in that virtualenv. Need to be enabled in each project.
 
4. Where to observe the log if any?

Kamil Libich

unread,
Mar 12, 2012, 1:40:58 PM3/12/12
to trac-...@googlegroups.com
Ok, bit of log I get when I want to connect from tracViewer.

====================================================================================
2012-03-12 10:07:07,967 Trac[session] DEBUG: Retrieving session for ID 'klm'
2012-03-12 10:07:07,967 Trac[chrome] DEBUG: Prepare chrome data for request
2012-03-12 10:10:48,692 Trac[main] DEBUG: Dispatching <Request "GET u'/admin/ticket/versions'">
2012-03-12 10:10:48,693 Trac[cache] DEBUG: cache metadata undefined (youngest_rev=u'')
2012-03-12 10:10:48,693 Trac[cache] INFO: repos rev [0] != cached rev [None]
2012-03-12 10:10:48,694 Trac[chrome] DEBUG: Prepare chrome data for request
2012-03-12 10:10:48,697 Trac[session] DEBUG: Retrieving session for ID 'klm'
2012-03-12 10:10:49,037 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/site/your_project_logo.png'">
2012-03-12 10:10:49,038 Trac[session] DEBUG: Retrieving session for ID 'klm'
2012-03-12 10:10:49,038 Trac[chrome] DEBUG: Prepare chrome data for request
2012-03-12 10:10:54,028 Trac[main] DEBUG: Dispatching <Request "GET u'/admin/ticket/type'">
====================================================================================

I installed the plugin according to instructions in trac-hacks. I don't have the 'problem' with the PYTHONPATH any more
I modified trac.ini file with components section.

Anything obvious?

Kamil


--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/jmGuKdyZsIYJ.

osimons

unread,
Mar 12, 2012, 5:05:08 PM3/12/12
to trac-...@googlegroups.com


On Monday, March 12, 2012 6:40:58 PM UTC+1, Kamil wrote:
Ok, bit of log I get when I want to connect from tracViewer.

====================================================================================
2012-03-12 10:07:07,967 Trac[session] DEBUG: Retrieving session for ID 'klm'
2012-03-12 10:07:07,967 Trac[chrome] DEBUG: Prepare chrome data for request
2012-03-12 10:10:48,692 Trac[main] DEBUG: Dispatching <Request "GET u'/admin/ticket/versions'">
2012-03-12 10:10:48,693 Trac[cache] DEBUG: cache metadata undefined (youngest_rev=u'')
2012-03-12 10:10:48,693 Trac[cache] INFO: repos rev [0] != cached rev [None]
2012-03-12 10:10:48,694 Trac[chrome] DEBUG: Prepare chrome data for request
2012-03-12 10:10:48,697 Trac[session] DEBUG: Retrieving session for ID 'klm'
2012-03-12 10:10:49,037 Trac[main] DEBUG: Dispatching <Request "GET u'/chrome/site/your_project_logo.png'">
2012-03-12 10:10:49,038 Trac[session] DEBUG: Retrieving session for ID 'klm'
2012-03-12 10:10:49,038 Trac[chrome] DEBUG: Prepare chrome data for request
2012-03-12 10:10:54,028 Trac[main] DEBUG: Dispatching <Request "GET u'/admin/ticket/type'">
====================================================================================

I installed the plugin according to instructions in trac-hacks. I don't have the 'problem' with the PYTHONPATH any more
I modified trac.ini file with components section.

Anything obvious?


Yes. The most obvious is that the log does not contain anything related to RPC. If you can make a request to /rpc and the RPC plugin is working, I suppose your problem may be related to the ios app rather than Trac and RPC plugin. Does a /rpc (or /login/rpc) web request return a nice overview of the RPC documentation?

I don't know the TracViewer app, and without any useful error information there is not much more I can do to help.

Have you tried the TracViewer support contacts?


:::simon

Reply all
Reply to author
Forward
0 new messages