Let's assume you want to implement some new feature in moshpit. You would fork this repo and then clone the fork to your local machine where you would work on the new features. But before you start coding you need to set up the virtual environment. So you follow the instructions in the wiki and run the following (notice how moshpit is left out of the mamba create command since you will install your local copy and not the version that is available through mamba).
So far so good, but then running anything (e.g. qiime dev refresh-cache) will return this error:
ImportError: cannot import name 'BrackenDBDirectoryFormat' from 'q2_types_genomics.kraken2'
This error comes from q2_types_genomics/kraken2/__init__.py (and perhaps the other files in q2_types_genomics/kraken2). The version that gets installed is missing some classes that are used by moshpit.
Ok problem solved! Sadly not, apparently q2-types-genomics is not the only incompatible package. If we run qiime dev refresh-cache we will get the following error.
TypeError: BLAST6 is not a variant of SampleData.field['type']
The error comes from the q2-types package. It boils down to the q2_types/feature_data/_type.py lines 51-53.
Woohoo! We solved it! Almost. Running qiime dev refresh-cache will return import errors, essentially complaining that some libraries are missing from the environment. Just
pip install xmltodict tqdm
(the libraries that are missing) and you are good to go.
Let's assume you want to implement some new feature in moshpit. You would fork this repo and then clone the fork to your local machine where you would work on the new features. But before you start coding you need to set up the virtual environment. So you follow the instructions in the wiki and run the following (notice how moshpit is left out of the
mamba create
command since you will install your local copy and not the version that is available through mamba).So far so good, but then running anything (e.g.
qiime dev refresh-cache
) will return this error:This error comes from
q2_types_genomics/kraken2/__init__.py
(and perhaps the other files inq2_types_genomics/kraken2
). The version that gets installed is missing some classes that are used by moshpit.Installed version:
However, these classes are available in the current version of
q2-types-genomics
.Current GitHub version:
link to lines of code in
q2-types-genomics
So we can fix it by running the following.
Ok problem solved! Sadly not, apparently
q2-types-genomics
is not the only incompatible package. If we runqiime dev refresh-cache
we will get the following error.The error comes from the
q2-types
package. It boils down to theq2_types/feature_data/_type.py
lines 51-53.Old version (installed with conda/mamba):
New version (available in GitHub):
link to lines of code in
q2-types
Again we uninstall the guilty package and clone the new version and install it locally.
Woohoo! We solved it! Almost. Running
qiime dev refresh-cache
will return import errors, essentially complaining that some libraries are missing from the environment. Just(the libraries that are missing) and you are good to go.