Installed qiime2 but getting SyntaxError: invalid syntax error

Hello everyone,

I hope you all are safe and healthy. I am new to qiime2 but I do have some experience especially with earlier versions. As a result I was very excited when the newest update was released qiime2-2020.11. However, upon installing it I got this massive SyntaxError: invalid syntax as seen below

SyntaxError: invalid syntax
(qiime2-2020.11_better) Calvin-Cornells-MacBook-Pro:~ eyehillentertainment$ qiime --help
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/2.7/bin/qiime”, line 11, in
load_entry_point(‘q2cli==2020.11.1’, ‘console_scripts’, ‘qiime’)()
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/ init .py”, line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/ init .py”, line 2852, in load_entry_point
return ep.load()
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/ init .py”, line 2443, in load
return self.resolve()
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/ init .py”, line 2449, in resolve
module = import (self.module_name, fromlist=[’ name '], level=0)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/q2cli-2020.11.1-py2.7.egg/q2cli/ main .py”, line 11, in
import q2cli.commands
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/q2cli-2020.11.1-py2.7.egg/q2cli/commands.py”, line 226
options = [*self._inputs, *self._params, *self._outputs, *self._misc]

And as a result, of this error qiime2 doesn’t work at all. Hence if I could please have some help in solving this problem it would be greatly appreciated.

To install this version of qiime2 I natively installed it using https://docs.qiime2.org/2020.11/install/native/#activate-the-conda-environment

However, using the link that qiime2 provided caused massive conflicts eventually leading to qiime2 failing to install. So i looked up this problem and I found this link here Instalation qiime 2020.11 Found conflicts! Looking for incompatible packages

Which suggested I download new copies of the environment files which I did by downloading this package found on GitHub https://github.com/qiime2/environment-files

Next I unpackaged it and I did the following environment-files/2020.11/release/ it was within this folder i found this file
qiime2-2020.11-py36-osx-conda.yml

So i copied it and pasted it where my files usually get downloaded and I then followed the instructions on https://docs.qiime2.org/2020.11/install/native/#activate-the-conda-environment

Therefore any help would be greatly appreciated and would mean a lot to me.

Thank you very much, and happy holidays everyone.

Hi @CalvinCornell!

Please try the Native Installation instructions again - there was a few hours-long window last week where the environment file was broken because one of the packages we depend on was removed from anaconda.org.

The error messages above indicate that you have somehow installed QIIME 2 into a Python 2 environment, which is not supported, I suspect something went sideways when you tried to override the usual installation procedure.

Keep us posted!

:qiime2:

1 Like

Hello thermokarst,

Thank you so very much for your help and assistance it is greatly appreciated. I followed your advice and I tried the Native Installation again and qiime2 was successfully loaded this time which is great.

However, I still got the same error messages as above. As a result, I feel that you are right and the problem might lies in Qiime2 being installed in a Python2 environment. As a result, could I please have some help in switching it/Qiime2 to another version of Python (I currently have python version 3.8 and 3.9 installed).

Thank you so very much, and I hope you have a wonderful day.

Please run the following command and copy-and-paste the entire results here:

conda activate qiime2-2020.11
env

Thanks!

Hello,

Thank you very much and I ran both commands and have pasted the results here. i do greatly apologize of the large amount of codes.

(base) Calvin-Cornells-MacBook-Pro:~ eyehillentertainment$ conda activate qiime2-2020.11_newer

Traceback (most recent call last):

File "/Library/Frameworks/Python.framework/Versions/2.7/bin/qiime", line 11, in <module>

load_entry_point('q2cli==2020.11.1', 'console_scripts', 'qiime')()

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point

return get_distribution(dist).load_entry_point(group, name)

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point

return ep.load()

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2443, in load

return self.resolve()

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve

module = __import__(self.module_name, fromlist=['__name__'], level=0)

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/q2cli-2020.11.1-py2.7.egg/q2cli/__main__.py", line 11, in <module>

import q2cli.commands

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/q2cli-2020.11.1-py2.7.egg/q2cli/commands.py", line 226

options = [*self._inputs, *self._params, *self._outputs, *self._misc]

^

SyntaxError: invalid syntax

(qiime2-2020.11_newer) Calvin-Cornells-MacBook-Pro:~ eyehillentertainment$ env

AS=x86_64-apple-darwin13.4.0-as

LDFLAGS=-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/lib -L/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/lib

AR=x86_64-apple-darwin13.4.0-ar

RSTUDIO_WHICH_R=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/R

ac_cv_func_malloc_0_nonnull=yes

JAVA_LD_LIBRARY_PATH=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/lib/server

TERM_PROGRAM=Apple_Terminal

ac_cv_func_realloc_0_nonnull=yes

OBJC=x86_64-apple-darwin13.4.0-clang

HOST=x86_64-apple-darwin13.4.0

SHELL=/bin/bash

TERM=xterm-256color

NM=x86_64-apple-darwin13.4.0-nm

PYTHONNOUSERSITE=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/lib/python*/site-packages/

CPPFLAGS=-D_FORTIFY_SOURCE=2 -isystem /Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/include

TMPDIR=/var/folders/ry/_l5lh1r943145hy3bv1ldc100000gn/T/

PAGESTUFF=x86_64-apple-darwin13.4.0-pagestuff

CONDA_SHLVL=2

Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.B2PiWN1EjR/Render

LIPO=x86_64-apple-darwin13.4.0-lipo

CONDA_PROMPT_MODIFIER=(qiime2-2020.11_newer)

TERM_PROGRAM_VERSION=421.1

GSETTINGS_SCHEMA_DIR_CONDA_BACKUP=

SIZE=x86_64-apple-darwin13.4.0-size

NMEDIT=x86_64-apple-darwin13.4.0-nmedit

SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk

TERM_SESSION_ID=3F1D41CC-26D5-456E-B023-6572C4D76782

CXX_FOR_BUILD=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-clang++

INSTALL_NAME_TOOL=x86_64-apple-darwin13.4.0-install_name_tool

SEGEDIT=x86_64-apple-darwin13.4.0-segedit

GFORTRAN=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-gfortran

ARBHOME=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/lib/arb

SEG_HACK=x86_64-apple-darwin13.4.0-seg_hack

USER=eyehillentertainment

CLANGXX=x86_64-apple-darwin13.4.0-clang++

LIBTOOL=x86_64-apple-darwin13.4.0-libtool

CONDA_EXE=/Users/eyehillentertainment/miniconda3/bin/conda

OTOOL=x86_64-apple-darwin13.4.0-otool

SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.o8LtjFJD2h/Listeners

DEBUG_FORTRANFLAGS=-march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/include -march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments

CXXFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -isystem /Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/include

CONDA_BUILD_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk

STRINGS=x86_64-apple-darwin13.4.0-strings

_CE_CONDA=

CHECKSYMS=x86_64-apple-darwin13.4.0-checksyms

CONDA_PREFIX_1=/Users/eyehillentertainment/miniconda3

ARBHOME_BACKUP=

PATH=/Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin:/Users/eyehillentertainment/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

GSETTINGS_SCHEMA_DIR=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/share/glib-2.0/schemas

MESON_ARGS=--buildtype release

DEBUG_CXXFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -Og -g -Wall -Wextra -isystem /Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/include

BUILD=x86_64-apple-darwin13.4.0

LD=x86_64-apple-darwin13.4.0-ld

CONDA_PREFIX=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer

F90=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-gfortran

PWD=/Users/eyehillentertainment

JAVA_HOME=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer

STRIP=x86_64-apple-darwin13.4.0-strip

CMAKE_ARGS=-DCMAKE_AR=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-ar -DCMAKE_RANLIB=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-ranlib -DCMAKE_LINKER=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-ld -DCMAKE_STRIP=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-install_name_tool -DCMAKE_LIBTOOL=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk

MPLBACKEND=Agg

F95=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-gfortran

LANG=en_CA.UTF-8

DEBUG_FFLAGS=-march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/include -march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments

XPC_FLAGS=0x0

F77=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-gfortran

REDO_PREBINDING=x86_64-apple-darwin13.4.0-redo_prebinding

CXX=x86_64-apple-darwin13.4.0-clang++

CC_FOR_BUILD=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-clang

CLANG=x86_64-apple-darwin13.4.0-clang

_CE_M=

XPC_SERVICE_NAME=0

SHLVL=1

HOME=/Users/eyehillentertainment

FORTRANFLAGS=-march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/include

CFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/include

_CONDA_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_x86_64_apple_darwin13_4_0

FC=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-gfortran

INDR=x86_64-apple-darwin13.4.0-indr

CONDA_PYTHON_EXE=/Users/eyehillentertainment/miniconda3/bin/python

LOGNAME=eyehillentertainment

build_alias=x86_64-apple-darwin13.4.0

JAVA_HOME_CONDA_BACKUP=

CONDA_DEFAULT_ENV=qiime2-2020.11_newer

DEBUG_CFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -Og -g -Wall -Wextra -isystem /Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/include

RANLIB=x86_64-apple-darwin13.4.0-ranlib

CMAKE_PREFIX_PATH=:/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer

CC=x86_64-apple-darwin13.4.0-clang

SEG_ADDR_TABLE=x86_64-apple-darwin13.4.0-seg_addr_table

DISPLAY=/private/tmp/com.apple.launchd.CB2OHeDBfB/org.macosforge.xquartz:0

host_alias=x86_64-apple-darwin13.4.0

JAVA_LD_LIBRARY_PATH_BACKUP=

LDFLAGS_LD=-pie -headerpad_max_install_names -dead_strip_dylibs -rpath /Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/lib -L/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/lib

R_LIBS_USER=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/lib/R/library/

OBJC_FOR_BUILD=/Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/bin/x86_64-apple-darwin13.4.0-clang

FFLAGS=-march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/eyehillentertainment/miniconda3/envs/qiime2-2020.11_newer/include

_=/usr/bin/env

(qiime2-2020.11_newer) Calvin-Cornells-MacBook-Pro:~ eyehillentertainment$

Great, thanks for that, @CalvinCornell!

Check out you PATH variable:

This is showing that your system-wide installations of Python will be searched prior to your conda envs, which is a really good explanation of why you're seeing the Python 2.7 errors you reported above. Usually when you follow the miniconda installer it automatically setups up this PATH variable for you, and sets the miniconda bin files to a good "position" in that search path. Have you modified your PATH at all? Perhaps you have a bashrc or bash_profile file that you've customized?

Hello

You’re welcome and thank you so very much as well your help has been greatly appreciated.

In regards to me modifying the PATH at all I am unsure therefore I do greatly apologize. However, before this problem started when I was using qiime2-2020.8 and would hit tab my code would no longer autocomplete even after I ran source tab-qiime

Therefore I went into
Library/Frameworks/Python.framework/Versions/3.8/bin/
Library/Frameworks/Python.framework/Versions/Current/bin (which is 3.9)
and I deleted the tab-qiime and qiime2 plugins (black box with “exec” in top left corner) because I erroneous thought that by deleting these I could just reinstall them when I reinstalled qiime2. But looking at these folders now there are no sign of either of these plugins.

Could this be the source of the problem?

Thanks again for all your wonderful help it is much appreciated.

1 Like

Definitely!

Hmm, I wonder how they got installed in there - did you run some pip install commands at some point, or python setup.py install? I ask because we don't actually distribute any Python packages, only Conda packages - so using conda, there isn't really any way to accidentally install into a system-wide Python installation.

1 Like

Hello thermokarst,

Awesome that is good we might have located the source of the problem that is good to hear.

And I am sorry but I don’t think I ran either pip install commands at some point, or python setup.py install however I have been trying lots of things to get it working so I might have accidentally run either or these at one point.

Very sorry and I do hope it can be fixed.

Thanks again for you help

Hello Thermokarst,

After talking with a graduate student I work with he recommend the best solution was to wipe clean my laptop and return it back to its original factor settings.

Therefore I did that and now everything appears to be working great in that qiime2-2020.11 is now working perfectly.

Hence thank you so very much for all your awesome and amazing help these last few days it is much appreciated.

Thanks again and happy holidays

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.