Galaxy local venv installation error

Hi everyone,
I’m trying to install Galaxy local on a server with Ubuntu 18.04.4 and python 3.10.2 .
Following the steps on the Get Galaxy page, I successfully cloned the git repository. Now the problem is that when I try to run galaxy for the first time using sh (or sudo sh I get the following error:

Creating Python virtual environment for Galaxy: .venv
using Python: python3
To avoid this, use the --no-create-venv flag or set $GALAXY_VIRTUAL_ENV to an
existing environment before starting Galaxy.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 5001k  100 5001k    0     0  25.3M      0 --:--:-- --:--:-- --:--:-- 25.3M
Verifying /tmp/galaxy-virtualenv-pIquIq/virtualenv-16.7.9.tar.gz checksum is 0d62c70883c0342d59c11d0ddac0d954d0431321a41ab20851facf2b222598f3
Using base prefix '/usr'
New python executable in /home/andreaf/galaxy/.venv/bin/python3
Also creating executable in /home/andreaf/galaxy/.venv/bin/python
Traceback (most recent call last):
  File "/tmp/galaxy-virtualenv-pIquIq/virtualenv-16.7.9/", line 2634, in <module>
  File "/tmp/galaxy-virtualenv-pIquIq/virtualenv-16.7.9/", line 860, in main
  File "/tmp/galaxy-virtualenv-pIquIq/virtualenv-16.7.9/", line 1162, in create_environment
    install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
  File "/tmp/galaxy-virtualenv-pIquIq/virtualenv-16.7.9/", line 1721, in install_python
    fix_local_scheme(home_dir, symlink)
  File "/tmp/galaxy-virtualenv-pIquIq/virtualenv-16.7.9/", line 1807, in fix_local_scheme
    if sysconfig._get_default_scheme() == "posix_local":
AttributeError: module 'sysconfig' has no attribute '_get_default_scheme'. Did you mean: 'get_default_scheme'?

How can I fix it?
Thank you for the help

seems a python version problem check the issue at
If you want to install galaxy properly on a local server I suggest you to follow the installation through Ansible Galaxy Installation with Ansible .
Alternatively, Galaxy is also available as Docker see Docker Hub

1 Like

Thank you, I’m trying with ansible but I#M having problems with the requirements.yml file:
Using it as on the document page results in the following error:

ERROR! Failed to parse the requirements yml at '/home/andreaf/galaxy/requirements.yml' with the following error:
mapping values are not allowed in this context
  in "b'/home/andreaf/galaxy/requirements.yml'", line 4, column 6

Then removing the spaces after “:” yamllint runs fine, but then when using the command ansible-galaxy install -p roles -r requirements.yml I et the following error:

ERROR! Unexpected Exception, this is probably a bug: 'str' object has no attribute 'keys'

That’s my yml file content:

++ b/requirements.yml
@@ -0,0 +1,14 @@
- src:galaxyproject.galaxy
- src:galaxyproject.nginx
- src:galaxyproject.postgresql
- src:natefoo.postgresql_objects
- src:geerlingguy.pip
- src:uchida.miniconda
- src:usegalaxy_eu.certbot

I think you have some problem in the requirement.yml

++ b/requirements.yml
@@ -0,0 +1,14 @@

they are not part of the file, check the Ansible documentation at Installing content — Ansible Documentation for more information about requirement files.

1 Like

Ok, was just following the guide in the first link and they say to put that code in the requirements.yml file so I don’t get what’s wrong… Should I use something like

 - src: galaxyproject.galaxy
   version: 0.9.16
 - src: galaxyproject.nginx
   version: 0.7.0
 - src: galaxyproject.postgresql
   version: 1.0.3
 - src: natefoo.postgresql_objects
   version: 1.1
 - src: geerlingguy.pip
   version: 2.0.0
 - src: uchida.miniconda
   version: 0.3.0
 - src: usegalaxy_eu.certbot
   version: 0.1.5
1 Like