Error when trying to run Galaxy on MacOs

Hi,

I’m trying to run Galaxy on my Mac, a couple of months ago it worked perfectly fine. However, now, I get the following error when trying to run sh. run.sh

41-53-255-53:galaxy nina$ sh run.sh
Activating virtualenv at .venv
./scripts/common_startup_functions.sh: line 105: .venv/bin/activate: No such file or directory

Any suggestions? I’m grateful for any help!

Thanks a lot,
Nina

1 Like

You can try to remove the Galaxy virtualenv directory .venv, and then start Galaxy again.

1 Like

Thanks for your immediate reply.
Upon new Galaxy installation, there is no .venv directory!

Okay, I did this now:

141-53-255-53:galaxy nina$ rm -rf .venv
141-53-255-53:galaxy nina$ sh run.sh
Creating Python virtual environment for Galaxy: .venv
To avoid this, use the --no-create-venv flag or set $GALAXY_VIRTUAL_ENV to an
existing environment before starting Galaxy.
Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/2.7/bin/python
New python executable in /usr/local/bin/galaxy/.venv/bin/python
Traceback (most recent call last):
  File "/usr/local/bin/miniconda3/lib/python3.6/site-packages/virtualenv.py", line 2884, in <module>
    main()
  File "/usr/local/bin/miniconda3/lib/python3.6/site-packages/virtualenv.py", line 712, in main
    symlink=options.symlink)
  File "/usr/local/bin/miniconda3/lib/python3.6/site-packages/virtualenv.py", line 927, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/usr/local/bin/miniconda3/lib/python3.6/site-packages/virtualenv.py", line 1233, in install_python
    copy_exe_shared_libs_and_symlinks(executable, py_executable, home_dir)
  File "/usr/local/bin/miniconda3/lib/python3.6/site-packages/virtualenv.py", line 2843, in copy_exe_shared_libs_and_symlinks
    of = codefile(f, rpaths)
  File "/usr/local/bin/miniconda3/lib/python3.6/site-packages/virtualenv.py", line 2814, in codefile
    return machofile(file, list(initial_rpaths_transitive))
  File "/usr/local/bin/miniconda3/lib/python3.6/site-packages/virtualenv.py", line 2437, in __init__
    _, sos = zip(*mach_o_find_dylibs(file))
  File "/usr/local/bin/miniconda3/lib/python3.6/site-packages/virtualenv.py", line 2401, in mach_o_find_dylibs
    do_file(ofile, find_lc_load_dylib, offset_size(), results, regex)
  File "/usr/local/bin/miniconda3/lib/python3.6/site-packages/virtualenv.py", line 2370, in do_file
    do_file(file, offset_size(offset, size), *args)
TypeError: do_file() takes at least 4 arguments (3 given)
1 Like

It seems to be using virtualenv with python 3.6 instead of 2.7.

1 Like

I see. Any suggestions?

Can you execute

which -a python

and post the output here?

1 Like

I’m also having the same issue on a new galaxy install. It’s a new computer running OSX Mojave and python 2.7 .

btw “which -a python” didn’t tell me which version # but "python -v " did. The output I got was below.

kws-imac:~ kw$ which -a python

/usr/bin/python

kws-imac:~ kw$ python -v

# installing zipimport hook

import zipimport # builtin

# installed zipimport hook

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py

import site # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py

import os # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.pyc

import errno # builtin

import posix # builtin

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py

import posixpath # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.py

import stat # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py

import genericpath # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.py

import warnings # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.py

import linecache # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.py

import types # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py

import UserDict # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py

import _abcoll # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py

import abc # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.py

import _weakrefset # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.pyc

import _weakref # builtin

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.py

import copy_reg # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py

import traceback # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py

import sysconfig # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py

import re # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.py

import sre_compile # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.pyc

import _sre # builtin

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.py

import sre_parse # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.py

import sre_constants # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.pyc

dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so", 2);

import _locale # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py

import _sysconfigdata # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.py

import _osx_support # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.pyc

import encodings # directory /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.py

import encodings # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py

import codecs # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.pyc

import _codecs # builtin

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.py

import encodings.aliases # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.pyc

# /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.pyc matches /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py

import encodings.utf_8 # precompiled from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.pyc

Python 2.7.10 (default, Aug 17 2018, 19:45:58)

[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

dlopen("/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so", 2);

import readline # dynamically loaded from /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so

admin reformatted

Welcome, @KJW!

Depending on whether or not you have conda installed, you might need to specifically first create the .venv inside the galaxy directory with virtualenv. Install that first if you don’t have it.

The process goes something like this…

Make sure you are in the galaxy home directory:

$ pwd
/Users/me/1901/galaxy

Create the environment:

$ virtualenv -p /usr/bin/python .venv
Running virtualenv with interpreter /usr/bin/python
New python executable in /Users/me/1901/galaxy/.venv/bin/python
Installing setuptools, pip, wheel...
done.

Startup/initialize Galaxy:

$ sh run.sh
< a bunch of output logging ending with ... >
Starting server in PID NNNN.
serving on http://localhost:8080

Note: This was true last time I checked, and I still do it when starting up a local on MAC OSX. The admins can correct me if no longer needed and something else is going on!

Hi JennaJ,
Thanks for your quick reply. I’m in the Galaxy environment however virtual env fails to execute
.
kws-imac:~ kw$ cd galaxy/

kws-imac:galaxy kw$ virtualenv -p /usr/bin/python .venv

-bash: virtualenv: command not found

Thoughts on what to try next? Also, is the 1901 folder a custom folder that you made? mine is in Users/kw/galaxy

Thanks for your help !

1 Like

Yes, that is an example path. Yours is fine – just make sure you cd into that directory before running the virtualenv and sh run.sh commands.

It looks like you don’t have virtualenv installed yet. OSX will have pip (one way to install packages) already installed but you might need to update it. So, it may take a few steps, but how-to for all is covered here nicely: Pipenv & Virtual Environments — The Hitchhiker's Guide to Python

Also – I tried installing 19.01 without the python venv (conda instead) and it did start up the server but I haven’t tested it at all yet – might have problems. Python venv is/was better anyway for a few complicated reasons, so this is worth it AFAIK.

Hope that helps!

Update: Did fine one problem with the default Conda venv method (and there could be others!) – loading a fasa dataset into an IGV local browser fails, for some dependency (possibly Samtools but that is just a guess!).

Discovered during this Q&A: Local IGV with Galaxy doesn't work

Even people with administrative experience will start over and use the Python venv rather than attempt to fix the various issues that can come up when using a Conda venv.

So – it is definitely recommended to use a Python venv to avoid unnecessary issues.

Related Q&A: Example step-by-step for a basic local Galaxy install with an admin account created