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

The Django project is migrated locally to the Linux server and an error is reported: Django cannot be found

編輯:Python

background :

django The project is migrated locally to linux Server error : Can't find django.

Mingming project is connected with the environment venv To the server , Why can't I find it .

terms of settlement :

Configure the environment variables of the virtual environment

vim ~/.bash_profile


Add the following commands completely on the last line ,

export PYTHONPATH=/home/myproject/myapp/venv/Lib/site-packages
 
export LD_LIBRARY_PATH="/usr/local/lib"


/home/myproject/myapp/venv This is my own project , Depending on the path of the virtual environment

When the configuration is complete , Save and exit . Refresh the environment variables , Enable environment variables .

source ~/.bash_profile

---------------------------

Here's another one .

Activate the virtual environment in the project venv

source venv/bin/activate

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