Quantcast

galaxy venv problem

classic Classic list List threaded Threaded
2 messages Options
| Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

galaxy venv problem

Beginner TI
Hi,

During the installation or galaxy instance, I set up a directory to install all the python dependencies. Basically, whenever I install python modules, I do something like:

python setup.py install --prefix=/my/python/dir

as a result, there are tons of stuff installed there. I added this path to PYTHONPATH.

The reason I do this is that I don't want to use sudo to install galaxy python modules.

Now the problem...I was hoping not to use virtual env.  However galaxy is set to use it's own venv, and during the course of starting, it will unset the PYTHONPATH. That caused that installed tools didn't work because it could not find the modules installed.

Here is one example of how it is not working. The tool generated the following command in the script:

    gca -b /media/libraryfiles/galaxy-data-store/database/files/000/dataset_44.dat --span=3000 -g /media/libraryfiles/dep/cistrome-static-lib/ceaslib/GeneTable/mm9 --name=gca_out >& /media/libraryfiles/galaxy-data-store/database/files/000/dataset_95.dat
    cp gca_out.xls /media/libraryfiles/galaxy-data-store/database/files/000/dataset_94.dat

I could run that command in the terminal successfully, but not in the galaxy. It keeps reporting error that gca_out.xls isn't there. With the PYTHONPATH unset, when I run that command, I would get:

Traceback (most recent call last):
  File "/media/libraryfiles/dep/python/bin/gca", line 32, in <module>
    import CEAS.inout as inout
ImportError: No module named CEAS.inout

Once I put the PYTHONPATH back, 

export PYTHONPATH=/media/libraryfiles/dep/python/lib/python2.7/site-packages

then that gca command would generate the correct output file. 

I tried to use 

sh run.sh --skip-venv

However, it keeps giving me errors. It seems those were from not able to install the dependencies listed in requirements.txt.

I then installed those dependencies to my python directory as well. During the course had to remove some that came with system, and install the newer ones. 

Now it seems to be working. I'm just wondering, is this a good way to using system python with all the dependencies I installed? 

Thanks,
Rui




___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
| Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: galaxy venv problem

Nicola Soranzo-2
Hi,
you can read extensive documentation about the Galaxy framework dependencies here:

https://docs.galaxyproject.org/en/master/admin/framework_dependencies.html

As a general advice, I would recommend to keep the framework dependencies separated from the tool dependencies.
For the tool dependencies, you can:
- either use Conda (either search for an existing Conda package or create one)
- or use your virtualenv by sourcing it at job execution time using an env.sh file, see:
  https://docs.galaxyproject.org/en/master/admin/dependency_resolvers.html#galaxy-packages-dependency-resolver

Cheers,
Nicola

On 29/10/16 04:04, Beginner TI wrote:
Hi,

During the installation or galaxy instance, I set up a directory to install all the python dependencies. Basically, whenever I install python modules, I do something like:

python setup.py install --prefix=/my/python/dir

as a result, there are tons of stuff installed there. I added this path to PYTHONPATH.

The reason I do this is that I don't want to use sudo to install galaxy python modules.

Now the problem...I was hoping not to use virtual env.  However galaxy is set to use it's own venv, and during the course of starting, it will unset the PYTHONPATH. That caused that installed tools didn't work because it could not find the modules installed.

Here is one example of how it is not working. The tool generated the following command in the script:

    gca -b /media/libraryfiles/galaxy-data-store/database/files/000/dataset_44.dat --span=3000 -g /media/libraryfiles/dep/cistrome-static-lib/ceaslib/GeneTable/mm9 --name=gca_out >& /media/libraryfiles/galaxy-data-store/database/files/000/dataset_95.dat
    cp gca_out.xls /media/libraryfiles/galaxy-data-store/database/files/000/dataset_94.dat

I could run that command in the terminal successfully, but not in the galaxy. It keeps reporting error that gca_out.xls isn't there. With the PYTHONPATH unset, when I run that command, I would get:

Traceback (most recent call last):
  File "/media/libraryfiles/dep/python/bin/gca", line 32, in <module>
    import CEAS.inout as inout
ImportError: No module named CEAS.inout

Once I put the PYTHONPATH back, 

export PYTHONPATH=/media/libraryfiles/dep/python/lib/python2.7/site-packages

then that gca command would generate the correct output file. 

I tried to use 

sh run.sh --skip-venv

However, it keeps giving me errors. It seems those were from not able to install the dependencies listed in requirements.txt.

I then installed those dependencies to my python directory as well. During the course had to remove some that came with system, and install the newer ones. 

Now it seems to be working. I'm just wondering, is this a good way to using system python with all the dependencies I installed? 

Thanks,
Rui





___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
Loading...