安装Odoo 18依赖时遭遇ImportError:无法从wheel.bdist_wheel导入'get_abi_tag'
问题重现
我正在按照Odoo 18官方源码安装指南操作,但执行以下命令时遇到了问题:
pip install -r requirements.txt
收到的具体错误信息如下:
Ignoring asn1crypto: markers 'python_version < "3.11"' don't match your environment Ignoring Babel: markers python_version < "3.11"' don't match your environment ... Collecting asn1crypto==1.5.1 (from -r requirements.txt (line 4)) Using cached asn1crypto-1.5.1-py2.py3-none-any.whl.metadata (13 kB) ... Collecting rl-renderPM==4.0.3 (from -r requirements.txt (line 78)) Using cached rl_renderPM-4.0.3.tar.gz (36 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [20 lines of output] Traceback (most recent call last): File "C:\Users\Elite183\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() File "C:\Users\Elite183\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "C:\Users\Elite183\AppData\Local\Temp\pip-build-env-62xx76va\overlay\Lib\site-packages\setuptools\build_meta.py", line 334, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) File "C:\Users\Elite183\AppData\Local\Temp\pip-build-env-62xx76va\overlay\Lib\site-packages\setuptools\build_meta.py", line 304, in _get_build_requires self.run_setup() File "C:\Users\Elite183\AppData\Local\Temp\pip-build-env-62xx76va\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in run_setup exec(code, locals()) File "<string>", line 5, in <module> ImportError: cannot import name 'get_abi_tag' from 'wheel.bdist_wheel' (C:\Users\Elite183\AppData\Local\Temp\pip-build-env-62xx76va\overlay\Lib\site-packages\wheel\bdist_wheel.py) [end of output]
这个错误发生在构建requirements.txt中的依赖时,问题看起来和wheel.bdist_wheel相关。
我已经尝试过以下步骤:
- 确认Python版本:安装了Python 3.13(符合Odoo安装指南要求)
- 升级了pip、setuptools和wheel:
pip install --upgrade pip setuptools wheel - 尝试逐个安装依赖:
pip install <dependency_name> - 检查兼容性:确认Python 3.13与greenlet、lxml、Pillow、reportlab兼容
- 注意到部分依赖标记(如
python_version < "3.11")与当前环境不匹配
我的疑问:
- 有没有人在Python 3.13下安装Odoo时遇到过类似问题?
- Python 3.13和greenlet、lxml、Pillow、reportlab这些依赖会不会存在兼容性问题?
- 我该采取什么步骤来解决这个问题,成功安装Odoo依赖?
解决方案与问题解答
我碰到过好几个用户在Python 3.13环境下安装Odoo 18时遇到这个问题,本质原因是高版本wheel移除了get_abi_tag方法,但rl-renderPM 4.0.3(你安装日志里的这个包)还在调用这个已被废弃的方法。下面是具体的解决步骤和对你疑问的解答:
一、快速修复步骤
降级wheel到兼容版本
先把wheel降级到还保留get_abi_tag的版本,比如0.38.4:pip install wheel==0.38.4这个版本刚好能满足rl-renderPM的构建需求,不会触发导入错误。
重新安装依赖
之后再重新执行依赖安装命令:pip install -r requirements.txt忽略那些"Ignoring"提示
你看到的Ignoring asn1crypto: markers 'python_version < "3.11"'这类提示完全正常——Odoo的requirements.txt内置了多Python版本的兼容配置,这些旧版本依赖是给Python 3.10及以下版本用的,Python 3.13会自动跳过它们,使用适配高版本的替代依赖,所以不用管这些提示。如果单独安装rl-renderPM还是有问题
可以先手动安装它的依赖reportlab,再安装rl-renderPM:pip install reportlab pip install rl-renderPM==4.0.3
二、对你疑问的解答
有没有人遇到过类似问题?
当然有,Python 3.13发布后,不少使用旧版本扩展包的项目都碰到了这个wheel兼容性问题,Odoo 18的依赖里rl-renderPM还没更新适配最新wheel版本,所以这类报错很常见。Python 3.13和greenlet等核心依赖兼容吗?
完全兼容!greenlet、lxml、Pillow、reportlab的最新版本都已经支持Python 3.13,你遇到的问题和这些包本身无关,只是rl-renderPM和高版本wheel的适配问题。后续还有什么需要注意的?
安装完成后,如果需要更新wheel到最新版本,也可以再执行pip install --upgrade wheel,不会影响已经安装好的依赖;如果后续Odoo更新了requirements.txt里的rl-renderPM版本,这个问题也会自动消失。
备注:内容来源于stack exchange,提问作者Lucas

