程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

No Python application found, check your startup logs for errors error resolution

編輯:Python

It's tumbling today django When I was working on the project, I suddenly came across a bug, At first, it reported an internal server error :“Internal Server Error”, The status of the server is Nginx Open the 8000 port ,uWSGI The service is also starting , Then we start to check , First of all, from the Nginx Lay hands on , Line by line inspection Nginx After the configuration is OK , Restart again , The result is still such a problem , It seems to be the same Nginx It doesn't matter. ; And then I started looking uwsgi Configuration issues , Whether it's modification socket Ports are still increased module Parameters , Can't solve the problem , But if you close uwsgi Words , Will be submitted to the ”502 Bad Gateway“ Error of , And this error represents nginx Reverse proxy configuration succeeded , But the corresponding uWSGI Not activated , So also exclude uWSGI Configuration issues .......
At this time, I realized that checking uwsgi.log journal , therefore sudo vim uwsgi.log Walk up , Sure enough, I saw the error message :

no python application found, check your startup logs for errors
The translation is : Can't find python Applications , Please check the startup log for errors

Combine with the top “No module named django”, It seems that it should be python Environmental problems , Because I installed anaconda Version of python3, There is django Of these modules , And I started django The service should be provided by the server itself python2, So the next step is to modify python The environment variable of .
I started with sudo vim /etc/profile , Add a line at the end of the file :
export PATH=/home/xxx/anaconda3/bin:$PATH
And then update it :source /etc/profile
But it doesn't work

I also tried to delete python2 and Add soft connection , as follows :

sudo ln -sf /home/xxx/anaconda3/bin/python /usr/bin/python

However, it still failed to change the default of the server python Environmental Science

Then try another way to modify the environment variables :

vi ~/.bashrc

The last line you see is this :

‘export PATH=/home/xxx/anaconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin’

And then we're going to get rid of anaconda3 Delete all other environment variables except , And modify it anaconda3 The content of :

‘export PATH=/home/xxx/anaconda3/bin:$PATH’

Finally save and exit , Update again :source ~/.bashrc

go back to django In the project file ,killall -s INT uwsgi Kill all the uwsgi process ,uwsgi --ini uwsgi.ini restart uwsgi,django The project can be accessed normally .

see python edition :python -V
Or enter directly python Console :

You can see that the environment of use has changed to anaconda 了 .
|
|
|
|
.


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved