AzureML Prompt Flow中‘No Module named 'azureml.fsspec'’问题求助
问题背景
在Azure ML Prompt Flow中处理文件数据时,按照官方文档指引执行pip install -U azureml-fsspec mltable安装依赖后,运行Python步骤始终报No Module named 'azureml.fsspec'错误。后续发现版本冲突:azureml-dataset-runtime 1.51.0要求azureml-dataprep版本在4.10.0a~4.11.0a之间,而新版azureml-fsspec、mltable要求azureml-dataprep≥4.11.1;指定安装azureml-fsspec 1.0.0和mltable 1.3.0后问题仍存在。
可行解决方法
确认环境一致性
确保在Prompt Flow关联的计算实例的目标Python环境中执行安装命令。可通过终端运行which python(Linux/macOS)或where python(Windows)确认当前环境路径,再执行pip list检查azureml-fsspec是否已成功安装。若使用conda环境,需先激活对应环境:conda activate <你的环境名>安装兼容版本组合
直接安装一套完全兼容的版本包,同时满足azureml-dataset-runtime 1.51.0和指定依赖的要求:pip install azureml-fsspec==1.0.0 mltable==1.3.0 azureml-dataprep==4.11.0a20230306清理缓存重装
卸载冲突包后,禁用缓存重新安装,避免缓存导致的版本异常:pip uninstall -y azureml-fsspec mltable azureml-dataprep azureml-dataset-runtime pip install --no-cache-dir azureml-fsspec==1.0.0 mltable==1.3.0 azureml-dataset-runtime==1.51.0指定Prompt Flow步骤的Python环境
在Prompt Flow的Python步骤设置中,明确指定安装了依赖的Python解释器路径,确保步骤运行时使用正确的环境。
内容的提问来源于stack exchange,提问作者Keenan Grant

