My goal is to show a Django welcome application in the world that uses postgres for an EC2 instance running under Ubuntu. I logged in via ssh and cloned the git repository containing the Django project with this requirement. Txt:
Django==1.8.2 djangorestframework==3.1.2 psycopg2==2.6
I created virtualenv, and then when I ran (ec2_deploy_test) ubuntu@ip-172-31-22-100 :~/ec2-deploy-test$ pip install -r requirements.txt , this exception was thrown:
Collect psycopg2 == 2.6 (from -r requirements.txt (line 3)) / home / ubuntu / Envs / ec 2_deploy_test / local / lib / python2.7 / site-packages / pip / vendor / requests / packages / urllib3 / util /ssl.py:90: InsecurePlatformWarning: The true SSLContext is not available. This prevents urllib3 from properly configuring SSL and may cause some SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning . InsecurePlatformWarning Download psycopg2-2.6.tar.gz (367kB) 100% | โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | 368kB 785kB / s Wheels for assembling assembled packages: psycopg2 Exception: Traceback (most recent last call): File "/home/ubuntu/Envs/ec2_deploy_test/local/lib/python2.7/site-packages/pip/basecommand.py" , line 223, basically status = self.run (options, args) File "/home/ubuntu/Envs/ec2_deploy_test/local/lib/python2.7/site-packages/pip/commands/install.py", line 291 , in perspective wb.build (autobuilding = True) File "/home/ubuntu/Envs/ec2_deploy_test/local/lib/python2.7/site-packages/pip/wheel.py", line 753, in the assembly make_dir (output_dir) File "/home/ubuntu/Envs/ec2_deploy_test/local/lib/python2.7/site-packages/pip/utils/ init .py", line 70, in the os.makedirs provisioning file (path) File "/ home / ubuntu / Envs / ec2_deploy_test / lib / python2.7 / os.py ", line 150, in makedirs makedirs (h ead, mode) File "/home/ubuntu/Envs/ec2_deploy_test/lib/python2.7/os.py", line 150, in makedirs makedirs (head, mode) File "/ home / ubuntu / Envs / ec2_deploy_test / lib / python2.7 / os.py ", line 150, in makedirs makedirs (head, mode) File" /home/ubuntu/Envs/ec2_deploy_test/lib/python2.7/os.py ", line 157, in makedirs mkdir (name , mode) OSError: [Errno 13] Permission denied: '/home/ubuntu/.cache/pip/wheels/ab'
Then I ran (ec2_deploy_test) ubuntu@ip-172-31-22-100 :~/ec2-deploy-test$ sudo pip install -r requirements.txt and psycopg2 successfully installed.
Why do I need root privileges to install the python package in my virtual environment? I am new to Linux and sysadmin in general, so all tips are welcome. Thanks in advance.
source share