Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not install packages due to an EnvironmentError in ec2 server

i'm typing the following in my working amazon ec2 linux server. (with ENV activated)

pip install pillow

getting this error:

Could not install packages due to an EnvironmentError: 
[Errno 13] Permission denied: '/home/ec2-user/env/lib64/python3.5/site-packages/Pillow-5.1.0.dist-info'. 
Consider using the `--user` option or check the permissions.

if i use --user i get: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

like image 597
Dev9977 Avatar asked Jan 28 '26 20:01

Dev9977


1 Answers

Based on your answers, what happened is that you used sudo when you created the virtualenv so root owns it.

sudo chown ec2-user:ec2-user -R ~ec2-user/env will fix this and make ec2-user the owner of the directory (and subdirectories) again.

like image 174
Benjamin Hicks Avatar answered Jan 30 '26 11:01

Benjamin Hicks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!