openerp-client trunk: deployment fails with python 2.6 (ubuntu 10.04)

Bug #674231 reported by Inaki Fernandez - OpenERPappliance.com
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo GTK Client (MOVED TO GITHUB)
Fix Released
High
OpenERP sa GTK client R&D

Bug Description

SCENARIO:

openerp-client trunk with latest updates from launchpad
python 2.6
ubuntu 10.04

DEPLOYMENT:

$ sudo python setup.py install
running install
running build
running build_conf
running build_py
package init file 'bin/__init__.py' not found (or not a regular file)
package init file 'bin/__init__.py' not found (or not a regular file)
running build_scripts
copying openerp-client -> build/scripts-2.6
changing mode of build/scripts-2.6/openerp-client from 644 to 755
running build_mo
running install_lib
running install_scripts
copying build/scripts-2.6/openerp-client -> /usr/local/bin
changing mode of /usr/local/bin/openerp-client to 755
running install_data
running install_egg_info
Removing /usr/local/lib/python2.6/dist-packages/openerp_client-6.0.0_rc1_1.egg-info
Writing /usr/local/lib/python2.6/dist-packages/openerp_client-6.0.0_rc1_1.egg-info
running install_mo

OPENERP-CLIENT FAILS WHEN LAUNCHED FROM DEFAULT PATH:

openerp-client
cd: 2: can't cd to /usr/lib/python2.6/site-packages/openerp-client
/usr/bin/python: can't open file './openerp-client.py': [Errno 2] No such file or directory

DEFAULT PATH:

$ which openerp-client
/usr/local/bin/openerp-client

CONTENT OF ABOVE SCRIPT:

$ cat /usr/local/bin/openerp-client
#!/bin/sh
cd /usr/lib/python2.6/site-packages/openerp-client
exec /usr/bin/python ./openerp-client.py $@

BUT OPENERP-CLIENT SEEMS TO DEPLOY IN THIS OTHER DIRECTORY:

$ ls -l /usr/local/lib/python2.6/dist-packages/openerp-client/
total 168
drwxr-sr-x 3 root staff 4096 Nov 6 17:48 SpiffGtkWidgets
drwxr-sr-x 2 root staff 4096 Nov 6 17:48 common
-rw-r--r-- 1 root staff 4802 Nov 6 17:06 environment_info.py
-rw-r--r-- 1 root staff 4164 Nov 6 17:48 environment_info.pyc
drwxr-sr-x 5 root staff 4096 Nov 6 17:48 modules
-rw-r--r-- 1 root staff 2059 Nov 6 17:06 observator.py
-rw-r--r-- 1 root staff 2568 Nov 6 17:48 observator.pyc
-rw-r--r-- 1 root staff 4627 Nov 6 17:06 openerp-client.py
-rw-r--r-- 1 root staff 4008 Nov 6 17:48 openerp-client.pyc
-rw-r--r-- 1 root staff 7923 Nov 6 17:06 options.py
-rw-r--r-- 1 root staff 7967 Nov 6 17:48 options.pyc
drwxr-sr-x 3 root staff 4096 Nov 6 17:48 plugins
drwxr-sr-x 2 root staff 4096 Nov 6 17:48 printer
-rw-r--r-- 1 root staff 1799 Nov 6 17:06 release.py
-rw-r--r-- 1 root staff 1057 Nov 6 17:48 release.pyc
-rw-r--r-- 1 root staff 13951 Nov 6 17:06 rpc.py
-rw-r--r-- 1 root staff 15682 Nov 6 17:48 rpc.pyc
-rw-r--r-- 1 root staff 1301 Nov 6 17:06 service.py
-rw-r--r-- 1 root staff 986 Nov 6 17:48 service.pyc
-rw-r--r-- 1 root staff 1977 Nov 6 17:06 signal_event.py
-rw-r--r-- 1 root staff 1646 Nov 6 17:48 signal_event.pyc
-rw-r--r-- 1 root staff 3402 Nov 6 17:06 tiny_socket.py
-rw-r--r-- 1 root staff 3786 Nov 6 17:48 tiny_socket.pyc
drwxr-sr-x 2 root staff 4096 Nov 6 17:48 tinygraph
drwxr-sr-x 2 root staff 4096 Nov 6 17:48 tools
-rw-r--r-- 1 root staff 6729 Nov 6 17:06 translate.py
-rw-r--r-- 1 root staff 6689 Nov 6 17:48 translate.pyc
drwxr-sr-x 5 root staff 4096 Nov 6 17:48 widget
drwxr-sr-x 2 root staff 4096 Nov 6 17:48 widget_search

Revision history for this message
Graeme Gellatly (gdgellatly) wrote :

Just change that file to read

#!/bin/sh
cd /usr/local/lib/python2.6/dist-packages/openerp-client
exec /usr/bin/python ./openerp-client.py $@

works for me

Changed in openobject-client:
assignee: nobody → OpenERP sa GTK client R&D (openerp-dev-gtk)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

I have to rewrite the setup.py because it doesn't use setuptools.

Will fix that during the next week.

Regards,

Stéphane

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Assigned to proper manager (setup and packaging) for evaluation

Thanks!

Changed in openobject-client:
assignee: OpenERP sa GTK client R&D (openerp-dev-gtk) → Stephane Wirtel (OpenERP) (stephane-openerp)
Revision history for this message
François Pinard (fpinard) wrote :

My problem might be closely related. In /usr/lib/python2.6/distutils/distutils.cfg, there are the following lines:

[install]
prefix=/usr/local

as a way so all further (non-bundled) Python installations go into /usr/local instead of /usr. The installed /usr/local/bin/openerp-client has:

cd /usr/lib/python2.6/site-packages/openerp-client

I changed it to be:

cd /usr/local/lib/python2.6/dist-packages/openerp-client

I guess we do not argue on the fact that "/local" was missing. About whether "site-packages" or "dist-packages" is to be preferred, I've no strong opinion, yet whatever gets used, should work.

Also, the generated ~/.openerprc got the following lines:

pixmaps = /usr/share/pixmaps/openerp-client
share = /usr/share/openerp-client

which I need to change so they read:

pixmaps = /usr/local/share/pixmaps/openerp-client
share = /usr/local/share/openerp-client

Thanks for listening. François.

tfr (Openerp) (tfr)
Changed in openobject-client:
status: Confirmed → Fix Committed
Revision history for this message
tfr (Openerp) (tfr) wrote :
Revision history for this message
François Pinard (fpinard) wrote :

Hi, people. The status now says "Fix Committed", but I'm not sure if the problem, as reported above, is fully solved.

A few days ago, I did:

   bzr launchpad-login pinard
   mkdir /usr/local/src/openerp6-trunk
   cd /usr/local/src/openerp6-trunk
   bzr clone lp:~openerp/openobject-client/trunk client

and this morning, just dit:

  cd /usr/local/src/openerp6-trunk/client
  bzr update

to get:

  Tree is up to date at revision 1777 of branch /usr/local/src/openerp6-trunk/client

Is that the proper revision including the fix? (I'm not much familiar with Bazaar) Presuming yes, "python setup.py install" ran flawlessly, so far that I can say, so an improvement definitely occurred. However, calling "openerp-client" prints:

  OpenERP Setup - The content of this file is generated at the install stage

as priorly reported in this thread. Changing /usr/local/bin/openerp-client so it reads (as suggested earlier in this thread) by:

  #!/bin/sh
  cd /usr/local/lib/python2.6/dist-packages/openerp-client
  exec /usr/bin/python ./openerp-client.py $@

and removing ~/.openerprc so it gets regenerated, gets "openerp-client" to print:

  WARNING:common.options:Config file /home/pinard/.openerprc does not exist !
  CRITICAL:init:Impossible d'ouvrir le fichier « openerp-icon.png » : Aucun fichier ou dossier de ce type
  CRITICAL:init:Ensure that the file /home/pinard/.openerprc is correct

In ~/.openerprc, I still have to change lines:

  pixmaps = /usr/share/pixmaps/openerp-client
  share = /usr/share/openerp-client

so they read (as reported earlier in this thread):

  pixmaps = /usr/local/share/pixmaps/openerp-client
  share = /usr/local/share/openerp-client

So, the ~/.openerprc file is not correctly generated.

Am I really testing the installed fix? If not, would you advise me about how to proceed?

Thanks for your attention. François

Revision history for this message
tfr (Openerp) (tfr) wrote :

Hi, no you're right, the deployement issue is not fully solve.

There is a workaround for now :
there is a configure file

so try
remove your .openerprc
then
./configure --prefix=/usr/local (or /usr )
make
sudo make install

Should work directly

and actualy the make file use the setup.py with option --root=/ it change everything
don't ask me why

Changed in openobject-client:
assignee: Stephane Wirtel (OpenERP) (stephane-openerp) → OpenERP sa GTK client R&D (openerp-dev-gtk)
tfr (Openerp) (tfr)
Changed in openobject-client:
status: Fix Committed → Fix Released
Revision history for this message
Simos Xenitellis  (simosx) wrote :

I am running the latest stable OpenERP. I do not know whether it uses this fix.

The source of the problem appears to be that

1. To build and install the server, you do

python setup.py build
sudo python setup.py install

2. To build and install the client, you COULD do

python setup.py build
sudo python setup.py install

but this gives you the problem with misconfigured paths.

What you need for the client is to do instead:

python ./configure
make
sudo make install

This difference is counter-intuitive. It should be the same series of commands in order to install both the server and the client.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.