安装Apache Airflow时遇目录不可安装错误求助
解决Apache Airflow安装错误:"Directory '' is not installable..."
问题原因
你使用的命令里的反斜杠\是Unix/Linux系统的换行标记,在Windows环境下会被pip误识别为要安装的目录路径,导致找不到setup.py或pyproject.toml文件,触发报错。
修复方案
方案1:使用单行命令
直接移除反斜杠,将命令整合成一行执行:
py -m pip install 'apache-airflow==2.8.1' --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.8.1/constraints-3.11.txt"
方案2:适配Windows的换行方式
如果需要拆分命令换行,根据你使用的终端工具选择对应的换行符:
- CMD终端:用
^作为换行符py -m pip install 'apache-airflow==2.8.1' ^ --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.8.1/constraints-3.11.txt" - PowerShell终端:用反引号
`作为换行符py -m pip install 'apache-airflow==2.8.1' ` --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.8.1/constraints-3.11.txt"
内容的提问来源于stack exchange,提问作者Júlia Lemes
相关产品推荐
相关产品推荐

