0

Try to install requirements.txt in Amazon EC2

pip3 install --force-reinstall -r requirements.txt

But get the following error messages

Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.

To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable

Processing /opt/concourse/worker/volumes/live/fdab5f8f-d9cf-4e28-48c7-38c4ee85b3c3/volume/cffi_1606255125152/work
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/opt/concourse/worker/volumes/live/fdab5f8f-d9cf-4e28-48c7-38c4ee85b3c3/volume/cffi_1606255125152/work'

I saw this post error when "sudo pip" on an AWS ec2 instance

here are some PATH variables

    echo $PATH
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.local/bin:/home/ec2-user/bin

sudo grep secure_path /etc/sudoers
Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin

so I tried

sudo grep secure_path /etc/sudoers

sudo env "PATH=$PATH" pip3 install --force-reinstall -r requirements.txt

But get the following error messages instead

WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.

Invalid requirement: 'cffi @ file:///opt/concourse/worker/volumes/live/fdab5f8f-d9cf-4e28-48c7-

38c4ee85b3c3/volume/cffi_1606255125152/work'

It looks like a path. Does it exist ?

Could anyone help? thank you!

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Chubaka
  • 2,933
  • 7
  • 43
  • 58
  • Have you tried `python -m pip install --force-reinstall -r requirements.txt`? – Will Walsh May 31 '21 at 03:15
  • Hi @WillWalsh thank you. I just tried ```python3 -m pip install --force-reinstall -r requirements.txt``` and got a similar error message ```Processing /opt/concourse/worker/volumes/live/fdab5f8f-d9cf-4e28-48c7-38c4ee85b3c3/volume/cffi_1606255125152/work ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/opt/concourse/worker/volumes/live/fdab5f8f-d9cf-4e28-48c7-38c4ee85b3c3/volume/cffi_1606255125152/work'``` – Chubaka May 31 '21 at 08:29
  • got it. there are some weird lines in my requirement.txt from CONDA. just fixed it and the install is successful now. thank you! – Chubaka May 31 '21 at 08:49

0 Answers0