ERROR: Directory is not installable. Neither 'setup.py' nor 'pyproject.toml'

19,202

Please try this:

   ADD requirements.txt ./
   pip install -r requirements.txt --no-deps -t python/lib/python3.6/site-packages/

syntax: ADD source destination

'ADD requirements.txt ./' adds requirements.txt (assumed to be at the cwd) to the docker image's './' folder.

Thus creating a layer from which the daemon has the context to the location of requirements.txt in the docker image.

More about it in dockerfile-best-practices

Share:
19,202

Related videos on Youtube

roastbeeef
Author by

roastbeeef

Updated on July 06, 2022

Comments

  • roastbeeef
    roastbeeef almost 2 years

    I've got the following error:

    ERROR: Directory is not installable. Neither 'setup.py' nor 'pyproject.toml'
    

    Background is that I'm following a guide online to expose an ML model via API Gateway on AWS that can be found here: Hosting your ML model on AWS Lambdas + API Gateway

    I'm trying to pull some python packages into a local folder using the following command:

    pip install -r requirements.txt --no-deps --target python/lib/python3.6/site-packages/
    

    I have also tried this:

    pip install -r requirements.txt --no-deps -t python/lib/python3.6/site-packages/
    

    and all I get is the above error. Google is pretty bare when it comes to help with this issue, any ideas?

    thanks,

    • Dinko Pehar
      Dinko Pehar over 3 years
      Can you try to specify package inside pip install command instead of using -r requirements.txt ? Maybe that solves the problem...