Hi , how do I deal with ```ERROR: Could not find a...
# general
f
Hi , how do I deal with
Copy code
ERROR: Could not find a version that satisfies the requirement myproject.common==1.0
ERROR: No matching distribution found for myproject.common==1.0
This is a package that only used in my org. How do I add the path of the file? Back in the days there was a
repository
field to specify the path.
Copy code
python_requirement(
    name='myproject.common', 
    dependencies=[':salt', ':pymysql'],
    requirements=[
        'myproject.common==1.0',
    ],)
f
But if it is a tar.gz file in the project directory, how do I specify the path?
h
I think that I'm not following. How did you do this in V1?
f
In v1, it was like this:
Copy code
python_requirement_library(
    name='myproject.common',
    requirements=[
        python_requirement(
           name='myproject.common', 
           requirement='myproject.common==1.0', 
           repository='3rdparty/python'),
    ],
)
h
@witty-crayon-22786 does this ring a bell?
w
…it doesn’t. let me see.
yea, i don’t see a
repository
argument in v1. did you maybe have custom macros for this?
Screen Shot 2022-04-14 at 14.46.03.png
f
hmmm let me check
w
as Eric mentioned though, v2 has two different strategies for this: can either set a local repository, or use a local requirement
f
ok then I think I will just use a local requirement
So I have to write something like this:
Copy code
Django @ file:///Users/pantsbuild/prebuilt_wheels/django-3.1.1-py3-none-any.whl
in which file? BUILD or requirement.txt?
h
You can either write that in requirements.txt, or use a python_requirement target in a build file. It does not matter for pants. Using requirements.txt is only a short hand
f
I think I fixed all those issues now! Thx so much~
🙌 1
❤️ 1
e
FWIW on V1, that screen shot shows off the issue. The repository argument was in the python_requirment object - which has no help. It was not on the python_requirement_library container.
👍 1