Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omero-metadata installation issue #22

Closed
sbesson opened this issue Sep 13, 2019 · 1 comment · Fixed by #124
Closed

omero-metadata installation issue #22

sbesson opened this issue Sep 13, 2019 · 1 comment · Fixed by #124
Assignees

Comments

@sbesson
Copy link
Member

sbesson commented Sep 13, 2019

Tried to test omero-py and a decoupled library like omero-metadata together, I found that the installation order seems to matter with 5.5.dev2.

This can be reproduced using two virtual environments

sbesson@ls30630:~ $ virtualenv /tmp/venv1
New python executable in /tmp/venv1/bin/python2.7
Also creating executable in /tmp/venv1/bin/python
Installing setuptools, pip, wheel...done.
sbesson@ls30630:~ $ virtualenv /tmp/venv2
New python executable in /tmp/venv2/bin/python2.7
Also creating executable in /tmp/venv2/bin/python
Installing setuptools, pip, wheel...done.
sbesson@ls30630:~ $ /tmp/venv1/bin/pip install omero-py==5.5dev2 omero-metadata==0.4.0
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting omero-py==5.5dev2
  Downloading https://files.pythonhosted.org/packages/ca/98/9085cec1c281b531537cf856404b88df38d67ea1c565cfc07d6131ea22da/omero-py-5.5.dev2.tar.gz (2.3MB)
     |████████████████████████████████| 2.4MB 1.5MB/s 
Collecting omero-metadata==0.4.0
  Downloading https://files.pythonhosted.org/packages/b3/84/a29d4fef46c564ca9988984c376e82b2297ef51a3e57da3b3936e4d9e78d/omero-metadata-0.4.0.tar.gz
Collecting zeroc-ice<3.7,>=3.6.4 (from omero-py==5.5dev2)
  Downloading https://files.pythonhosted.org/packages/1e/65/43c3ad2412467c731ee3c23bce03fad7e2b79df31301e27cc7b1b454554b/zeroc-ice-3.6.5.tar.gz (1.2MB)
     |████████████████████████████████| 1.2MB 12.4MB/s 
Building wheels for collected packages: omero-py, omero-metadata, zeroc-ice
  Building wheel for omero-py (setup.py) ... done
  Created wheel for omero-py: filename=omero_py-5.5.dev2-cp27-none-any.whl size=2786752 sha256=f129a7145496b2db504736fa401cdc74a3140705e3e9ce290305c4330ad9797c
  Stored in directory: /Users/sbesson/Library/Caches/pip/wheels/ef/33/d5/14b3e1771b18731097588668583c68e02375767a3f606c4887
  Building wheel for omero-metadata (setup.py) ... done
  Created wheel for omero-metadata: filename=omero_metadata-0.4.0-cp27-none-any.whl size=25739 sha256=e7df430d48219b0d08b1b6c6db2d6253433a95a9c6072f9681b6e994ab4fb818
  Stored in directory: /Users/sbesson/Library/Caches/pip/wheels/97/ed/f6/790aa61a63dd768a7a53874688e3124195424b9ec9eeab3eb0
  Building wheel for zeroc-ice (setup.py) ... done
  Created wheel for zeroc-ice: filename=zeroc_ice-3.6.5-cp27-cp27m-macosx_10_13_x86_64.whl size=2925471 sha256=3a5f1c4d3200c9ecfd2045fe9d1c8f56a8a53cdb8e802bff8e596c39896cb6ae
  Stored in directory: /Users/sbesson/Library/Caches/pip/wheels/d5/20/93/a2f791674372ad8e5664cdd8c3a0c128ae00a5b3a5c7cee538
Successfully built omero-py omero-metadata zeroc-ice
Installing collected packages: zeroc-ice, omero-py, omero-metadata
Successfully installed omero-metadata-0.4.0 omero-py-5.5.dev2 zeroc-ice-3.6.5
sbesson@ls30630:~ $ /tmp/venv2/bin/pip install omero-metadata==0.4.0 omero-py==5.5dev2 
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting omero-metadata==0.4.0
Collecting omero-py==5.5dev2
Collecting zeroc-ice<3.7,>=3.6.4 (from omero-py==5.5dev2)
Installing collected packages: omero-metadata, zeroc-ice, omero-py
Successfully installed omero-metadata-0.4.0 omero-py-5.5.dev2 zeroc-ice-3.6.5

The first environment successfully loads the metadata plugin while the second fails to discover it:

sbesson@ls30630:~ $ /tmp/venv1/bin/omero metadata
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!
usage: /tmp/venv1/bin/omero metadata [-h] [-C] [-s SERVER] [-p PORT]
                                     [-g GROUP] [-u USER] [-w PASSWORD]
                                     [-k KEY] [--sudo ADMINUSER] [-q]
                                     <subcommand> ...
/tmp/venv1/bin/omero metadata: error: too few arguments
sbesson@ls30630:~ $ /tmp/venv2/bin/omero metadata
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!
usage: /tmp/venv2/bin/omero [-h] [-v] [-d DEBUG] [--path PATH] [-C]
                            [-s SERVER] [-p PORT] [-g GROUP] [-u USER]
                            [-w PASSWORD] [-k KEY] [--sudo ADMINUSER] [-q]
                            <subcommand> ...
/tmp/venv2/bin/omero: error: argument <subcommand>: invalid choice: 'metadata'

choose from:
	admin, chgrp, chown, config, db, delete, download, errors, export, 
	fs, group, help, hql, import, ldap, load, login, logout, node, 
	obj, perf, quit, script, search, server, sessions, shell, tag, 
	testengine, upload, user, version

Running diff -r -x '*.pyc' /tmp/venv1/ /tmp/venv2/ reveals that both plugins are indeed competing to write under lib/python2.7/site-packages/omero/plugins/metadata.py.

@sbesson
Copy link
Member Author

sbesson commented Nov 29, 2019

Retested following the release of omero-py 5.6.dev7 with

FROM centos:7

RUN yum install -y python3
RUN useradd -ms /bin/bash omero

USER omero
WORKDIR /tmp
RUN python3 -m venv venv1 && venv1/bin/pip install https://github.com/ome/zeroc-ice-py-centos7/releases/download/0.2.1/zeroc_ice-3.6.5-cp36-cp36m-linux_x86_64.whl && venv1/bin/pip install --pre omero-py
RUN python3 -m venv venv2 && venv2/bin/pip install https://github.com/ome/zeroc-ice-py-centos7/releases/download/0.2.1/zeroc_ice-3.6.5-cp36-cp36m-linux_x86_64.whl && venv2/bin/pip install --pre omero-metadata

As expected, the first virtual environment requires OMERO_DEV_PLUGINS set to consume the deprecated metadata plugin while the second environment uses the omero-metadata plugin

[omero@7961ec8becd5 tmp]$ venv1/bin/omero metadata populate Dataset:1 --file foo
usage: venv1/bin/omero [-h] [-v] [-d DEBUG] [--path PATH] [-C] [-s SERVER]
                       [-p PORT] [-g GROUP] [-u USER] [-w PASSWORD] [-k KEY]
                       [--sudo ADMINUSER] [-q]
                       <subcommand> ...
venv1/bin/omero: error: argument <subcommand>: invalid choice: 'metadata'

choose from:
	admin, chgrp, chown, config, db, delete, download, errors, export, 
	fs, group, help, hql, import, ldap, load, login, logout, node, 
	obj, perf, quit, script, search, server, sessions, shell, tag, 
	testengine, upload, user, version
[omero@7961ec8becd5 tmp]$ OMERO_DEV_PLUGINS=1 venv1/bin/omero metadata populate Dataset:1 --file foo
This plugin is deprecated as of OMERO 5.4.8. Use the plugin available from https://pypi.org/project/omero-metadata/ instead.
Server: [localhost:4064]^CCancelled
[omero@7961ec8becd5 tmp]$ venv2/bin/omero metadata populate Dataset:1 --file foo
Server: [localhost:4064]^CCancelled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant