我正在尝试运行https://snakemake.readthedocs.io/en/stable/executor_tutorial/azure_aks.html教程。
现在管道启动了,但是在python/snakemake中出现了导入错误而失败。
WorkflowError:
The Python 3 package 'azure-storage-blob' need to be installed to use Azure Storage remote() file functionality. No module named 'azure'
File "/opt/conda/envs/snakemake/lib/python3.9/importlib/__init__.py", line 127, in import_module
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
在python中,导入azure是可能的。
Python 3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:39:48)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient, __version__
>>> print("Azure Blob Storage v" + __version__ + " - Python quickstart sample")
Azure Blob Storage v12.8.1 - Python quickstart sample
>>>
我试着把python + azure-storage-blob放到snakemake的环境文件中,但是这样做会导致新的问题。我也尝试过旧版本的python和后来的kubernetes。
好了,我找到答案了。
我使用——kubernetes版本安装的snakemake运行的是旧版本的snakemake。例如
snakemake/snakemake v6.6.1 67c6faaeec07 3 weeks ago 2.29GB
使用container-image参数强制使用最新的蛇形镜像
——container-image docker.io/snakemake/snakemake:最新
我能够让教程工作。