vendredi 29 mai 2015

how to change installation path of pip command? How to set default python directory for installation of packages using pip command

I have deployed my Django Application on AWS EC2, which is running properly. I dont know what happen but its giving me error for django.core.management as

Traceback (most recent call last):
  File "/home/ec2-user/myproject/manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

I googled and searched on SO answers also and gone through all the possible answers. The issue I am facing is, I am running cron jobs in my application which I set in settings.py. Due to this error it is not get executed on time. But I wondered that the other application I can access and its running properly. only the thing at the time of cronjob it giving this error.
One more issue I am facing is pip command is not working with root user

[ec2-user@ip-XXX-XXX-XXX-XXX ~]$ sudo pip install django
sudo: pip2.7: command not found

it is runnning with ec2-user. but due to lack of permissions it is not able to install or update the modules.
I have two versions of python python2.6 and python2.7, whenever I try to install modules it by default goes in python2.6 directory. I want to set the python version 2.7 default and the modules also should install in 2.7 directory. Please suggest me how to resolve. some similar question was there I applied all the answers but not worked. Please tell me how can I resolve this problem. Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire