Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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,

like image 509
roastbeeef Avatar asked Jun 17 '19 20:06

roastbeeef


People also ask

How install PIP using setup py?

Installing Python Packages with Setup.py To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.

What is setup py in Python?

The setup.py file is a Python file which indicates that the installation module/package is most likely packed and distributed using Distutils, the Python Module distribution standard.

How do you fix there was an error checking the latest version of PIP?

Solve the Warning: There was an error checking the latest version of pip error. The best way to solve this error is to install or update the pip module to the latest version. Before installing the pip module make sure that all the dependencies for this module should be installed.


1 Answers

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

like image 151
SDIdo Avatar answered Sep 20 '22 13:09

SDIdo