Skip to content

CONDA_PREFIX in util.py #377

@pavelToman

Description

@pavelToman

Bug Description
I like to install Qiime from sources, not by CONDA. There was a change: #367 and the logic break the installation from sources. The if conda_prefix is after it is used...

Steps to reproduce the behavior
qiime --help >>>

Sanity check failed: sanity check command qiime --help failed with exit code 1 (output: Traceback (most recent call last):
  File "/software/QIIME2/2025.4.0-foss-2024a-amplicon/bin/qiime", line 5, in <module>
    from q2cli.__main__ import qiime
  File "/software/QIIME2/2025.4.0-foss-2024a-amplicon/lib/python3.12/site-packages/q2cli/__main__.py", line 11, in <module>
    import q2cli.commands
  File "/software/QIIME2/2025.4.0-foss-2024a-amplicon/lib/python3.12/site-packages/q2cli/commands.py", line 16, in <module>
    from q2cli.core.config import CONFIG
  File "/software/QIIME2/2025.4.0-foss-2024a-amplicon/lib/python3.12/site-packages/q2cli/core/config.py", line 17, in <module>
    class CLIConfig():
  File "/software/QIIME2/2025.4.0-foss-2024a-amplicon/lib/python3.12/site-packages/q2cli/core/config.py", line 18, in CLIConfig
    path = os.path.join(q2cli.util.get_app_dir(), 'cli-colors.theme')
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/software/QIIME2/2025.4.0-foss-2024a-amplicon/lib/python3.12/site-packages/q2cli/util.py", line 17, in get_app_dir
    environment_cache = os.path.join(conda_prefix, 'var', 'q2cli')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 76, in join
TypeError: expected str, bytes or os.PathLike object, not NoneType
)

Expected behavior
Should work even without CONDA

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions