m2r2 icon indicating copy to clipboard operation
m2r2 copied to clipboard

Error when trying to run pip install -r requirements-dev.txt

Open Omcsesz opened this issue 1 year ago • 1 comments

Hello, Team!

I got an error when I try to run pip install -r requirements-dev.txt: ReqDevInstallDoesNotWork

Can you please support?

Omcsesz avatar Mar 26 '24 10:03 Omcsesz

Just passing by facing the same/similar problem. The issue is that one of the dependencies: typed-ast, which is not maintained anymore [0] (the authors suggest moving to the builtin module ast), has this code in it:

#include "code.h"

According to what's new in Python 3.11 [1]:

The non-limited API files cellobject.h, classobject.h, code.h, context.h, funcobject.h, genobject.h and longintrepr.h have been moved to the Include/cpython directory. Moreover, the eval.h header file was removed. These files must not be included directly, as they are already included in Python.h: Include Files. If they have been included directly, consider including Python.h instead. (Contributed by Victor Stinner in bpo-35134.)

Porting m2r2 from typed-ast to builtin ast module is probably the best long term fix. In the meanwhile, just replacing the

#include "code.h"

with

#include <Python.h>

should do, but requires patching the source of the dependency...

[0] https://github.com/python/typed_ast/issues/179 [1] https://docs.python.org/3.11/whatsnew/3.11.html

Edit: it seems that typed-ast is a transitive dependency, so whoever depends on it needs to migrate to ast...

Edit2/TL;DR: it's mypy that needs to be updated

steve-s avatar Apr 15 '24 10:04 steve-s