SyntaxError: future feature annotations is not defined

Hi all,
I am trying to install galaxy in my own compurter and I got this error when I run common “sh run.sh”.

“File “/anaconda3/envs/galaxy/lib/python3.6/site-packages/filelock/init.py”, line 8
from future import annotations
^
SyntaxError: future feature annotations is not defined”

I understand the error means that I need a newer version of python, however, I do have a python version 3.9, but it still runs in the python version 3.6. So I am not sure where went wrong.

Please help, thank you.

Hi @keee,
could you confirm that you are using the last Galaxy release:

git clone -b release_21.09 https://github.com/galaxyproject/galaxy.git

Regards

Hi,
Yes, it is what I have.

Best,
Ke

Do I have to creat an environment, python 3.6.10, to be able to run galaxy?

Best,
Ke

@keee Galaxy is working with Python 3.6 - 3.10. So that should not be the problem, but somehow you got a newer filelock package.

Can you remove your Galaxy env and recreate it? If you like you can recreate it with python 3.8 or so.

conda create -n galaxy python=3.9

2 Likes

Hi,
I did this as well, but when i try to run it will still use python3.6 for some reason, does not matter which conda environnment I am in. So, I have to eventually create a virtualenv to run the “sh run.sh” commond. It worked for me, I guess the problem is sloved, thanks everyone.

1 Like

If anyone is on Mac and installed conda, and have same issue with me. You need to:

  1. update your python to 3.9 or newer (3.7/8 will also have python errors, I tried
  2. remove galaxy environment that created automatically since you have conda installed:
conda env remove -n _galaxy_
  1. created a virtualenv on your computer and then run:
    sh run.sh --no-create-venv
    flag is needed otherwise it will created the galaxy environment again…
2 Likes

Hi @keee,
that problem has been recently fixed, but is not included in the 21.09 release. If you get the dev branch, it should work fine:

git clone https://github.com/galaxyproject/galaxy.git

Regards

1 Like