Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SyntaxError: future feature annotations is not defined [duplicate]

Tags:

python

conda

I am try to run code

sh run.sh

and it showed me the error

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 saw some solutions indicated that I need to update my python version, but I am in a python verion 3.9.7.

(py39) KedeMacBook-Pro:~ ke$ python --version
Python 3.9.7

However, in the error code it showed a python veriosn of 3.6. So, I am not sure where went wrong. Why it is not using the python envrionment that I have? Please help, thank you.

like image 418
keee Avatar asked Feb 20 '26 18:02

keee


1 Answers

Based on the error, it looks like your code is using Python 3.6 and not Python 3.9. This import is available starting from Python 3.7. Check run.sh to make sure it is referencing the right python interpreter.

I'd also recommend using a virtual env using the python version you require and running your script inside that.

like image 71
niranjan94 Avatar answered Feb 23 '26 07:02

niranjan94



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!