安装完我的django项目后,我在这里找到了一些文件:
/opt/pkgs/myproject/lib/python2.7/site-packages/myproject-2.3-py2.7.egg/dashboard/management/commands/myjob.py
/opt/pkgs/myproject/lib/python2.7/site-packages/myproject-2.3-py2.7.egg/manage.py
运行python manage.py myjob
或sudo python manage.py validate
时,错误为
python: can't open file 'manage.py': [Errno 2] No such file or directory
运行sudo python /opt/pkgs/myproject/lib/python2.7/site-packages/myproject-2.3-py2.7.egg/manage.py validate
如何解决?任何有用的文档?
更新
sys.path中:
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL']
我无法添加路径" /opt/pkgs/myproject/lib/python2.7/site-packages/myproject-2.3-py2.7.egg/manage.py"到sys.path 永久。