上一篇文章《Django个人博客教程-1:开发环境》我们简单介绍了Django个人博客的开发环境,这篇文章继续介绍Django个人博客的开发环境,Linux下编译安装Python3.7.x和IDE vscode的配置。
编译安装python3.7.7的脚本:
wget -c https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tar.xz
tar xvf Python-3.7.7.tar.xz && cd Python-3.7.7
./configure --prefix=/usr/local/python3.7
make -j$(nproc)
make install
ln -s /usr/local/python3.7/bin/python3.7 /usr/bin/python3.7
使用virtualenv新建python虚拟环境:
cd $HOME
virtualenv -p `which python3.7` docenv37 --no-download
source docenv37/bin/activate
vscode settings.json 配置如下:
{"python.pythonPath": "/home/shoutian/docenv37/bin/python3.7","editor.fontSize": 18,"python.linting.pylintPath": "pylint_django"}
注意"python.linting.pylintPath"的配置,我们需要在虚拟环境中执行 pip install pylint-django
文章非常好超喜欢
回复取消回复喜欢就好
回复取消回复