https://pantsbuild.org/ logo
r

ripe-gigabyte-88964

03/15/2023, 5:38 PM
Hey all, getting this error when trying to generate a Python lockfile:
Copy code
ERROR: Could not find a version that satisfies the requirement pandas==1.5.2
ERROR: No matching distribution found for pandas==1.5.2
When I remove that dependency from my
requirements.txt
the lockfile generation works. This version of pandas also definitely exists: https://pypi.org/project/pandas/#history. I have https://pypi.org/simple/ specified in my indexes field under
[python-repos]
. Also weird is that there are other dependencies that depend on pandas and it is able to locate a much older version, but there's no requirement that should prevent installation of this specific version.
p

proud-dentist-22844

03/15/2023, 5:43 PM
It is saying it can't find that version that also matches all the other constraints. There is probably an interpreter constraint or a version constraint on another dep that is making v1.5.2 be marked "incompatible".
p

polite-garden-50641

03/15/2023, 5:43 PM
this kind of error is in most case due to to wide range of python interpreter constraints defined in pants.toml https://www.pantsbuild.org/docs/python-interpreter-compatibility so for example, if you allow python 3.6, pants will try to find a version/wheel (aka distribution) for pandas that satisfies both the interpreter constraints (3.6) and the pandas version (1.5.2) and if that fails, that is the error you will be getting.
e

enough-analyst-54434

03/15/2023, 5:43 PM
Yeah, exactly, This is
*Requires:* Python >=3.8
@ripe-gigabyte-88964 if you re-run with
-ldebug
we can see the command line Pants uses to try to create the lock file. That will include what it thinks the
--interpreter-constraint
is.
🙏 1
~guaranteed
>=3.7,<4
p

polite-garden-50641

03/15/2023, 5:46 PM
r

ripe-gigabyte-88964

03/15/2023, 5:47 PM
Thanks all, never would've figured that out 😅