AWS pip configuration

We have a project with a large number of dependencies. The requirements.txt is frozen. To avoid problems with lower level dependencies I can use pip install --no-deps -r requirements.txt, but that doesn’t work for the heroku based install on AWS. I thought we might use the heroku advice and provide a setup.py and use -e . in the requirements.txt. However, when I do that locally I get a message from pip

$ pip install -r requirements.txt
Obtaining file:///home/robin/devel/otr (from -r requirements.txt (line 1))
ERROR: No .egg-info directory found in /tmp/pip-pip-egg-info-yt2type3

and pip doesn’t seem to be executing the setup.py file at all.

Is there a way to get the pip install to work for AWS?

AWS is really not the issue here; there are thousands of AMIs (machine images) available on AWS, and each of them has their own behaviors. If you’re experiencing an issue with a specific AMI (or group of similarly-configured AMIs), that issue is caused by the configuration inside that AMI.

For what it’s worth, I launch AWS EC2 VMs rather often (using a Debian-based AMI) and have no issues installing software using pip :slight_smile:

1 Like

The problem is not that pip install won’t work, but that I cannot configure the pip command line used. I didn’t set up the process that’s used to update the instances. The process uses a heroku compatible mechanism to run python based app. I believe heroku approach is used for compatibility. I cannot change the current setup (what you call the ami).

The documentation Python Dependencies via Pip | Heroku Dev Center indicates we can use a setup.py, but for other reasons I don’t wish to drop the requirements.txt so would like to use the -e . apprach heroku recommends. That seems to fail for me locally because I don’t have the .egginfo subdirectory so obviously I have misunderstood the -e option.

Either that, or the ‘heroku compatible mechanism’ isn’t as compatible as you’d like it to be :slight_smile:

In any case, the creators of the AMI you are using are the ones who will have to understand what you are trying to do and figure out why it’s not working. The issue you are experiencing is almost certainly caused by the configuration inside the AMI, not by Python or pip.

2 Likes