vscode设置python3.7调试环境(已更新)
汇总系列:https://www.cnblogs.com/dunitian/p/4822808.html#ai
CentOS安装Python3.7:https://www.cnblogs.com/dotnetcrazy/p/9360831.html
Update:
2018-08-08:pip install [--user] rope :让Python对象支持批量重命名(eg:Ctrl+R+R)
独立安装python3的:
用户设置里面添加一下python3的路径即可
附录:
如果先安装Anaconda,再通过anaconda安装VSCode则不用管环境配置(会配置好),如果先安装vscode就自己配置下环境吧:
如果没配置你自己配置一下,以Linux来说:(先查看路径,再配置)
扩充(配置规范提示和格式化):
命令参考:pip install [--user] xxx
规范化提示:pycodestyle or flake8(旧名字)
代码格式化:yapf or autopep8
VSCode配置参考:(Conda默认安装了pycodestyle)
附录:安装本地开发环境Python3.7
sudo apt-get install python3.7 sudo apt-get install python3.7-dbg curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py sudo python3.7 get-pip.py
sudo pip3.7 install pycodestyle
sudo pip3.7 install yapf
VSCode配置文件:
// 设置Python的路径
"python.pythonPath": "python3.7",
// "python.pythonPath": "/home/dnt/anaconda3/bin/python",
// 设置Python的代码格式化
"python.formatting.provider": "yapf",
// 设置Python的代码检查
"python.linting.flake8Path": "pycodestyle",
"python.linting.flake8Enabled": true,
sudo apt-get install python3.7
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会同时安装下列软件:
libpython3.7-minimal libpython3.7-stdlib python3.7-minimal
建议安装:
python3.7-venv python3.7-doc
下列【新】软件包将被安装:
libpython3.7-minimal libpython3.7-stdlib python3.7 python3.7-minimal
升级了 0 个软件包,新安装了 4 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 4,011 kB 的归档。
解压缩后会消耗 22.8 MB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 libpython3.7-minimal amd64 3.7.0~b3-1 [544 kB]
获取:2 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 python3.7-minimal amd64 3.7.0~b3-1 [1,563 kB]
获取:3 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 libpython3.7-stdlib amd64 3.7.0~b3-1 [1,685 kB]
获取:4 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 python3.7 amd64 3.7.0~b3-1 [219 kB]
已下载 4,011 kB,耗时 6秒 (691 kB/s)
正在选中未选择的软件包 libpython3.7-minimal:amd64。
(正在读取数据库 ... 系统当前共安装有 205966 个文件和目录。)
正准备解包 .../libpython3.7-minimal_3.7.0~b3-1_amd64.deb ...
正在解包 libpython3.7-minimal:amd64 (3.7.0~b3-1) ...
正在选中未选择的软件包 python3.7-minimal。
正准备解包 .../python3.7-minimal_3.7.0~b3-1_amd64.deb ...
正在解包 python3.7-minimal (3.7.0~b3-1) ...
正在选中未选择的软件包 libpython3.7-stdlib:amd64。
正准备解包 .../libpython3.7-stdlib_3.7.0~b3-1_amd64.deb ...
正在解包 libpython3.7-stdlib:amd64 (3.7.0~b3-1) ...
正在选中未选择的软件包 python3.7。
正准备解包 .../python3.7_3.7.0~b3-1_amd64.deb ...
正在解包 python3.7 (3.7.0~b3-1) ...
正在处理用于 mime-support (3.60ubuntu1) 的触发器 ...
正在处理用于 desktop-file-utils (0.23-1ubuntu3.18.04.1) 的触发器 ...
正在设置 libpython3.7-minimal:amd64 (3.7.0~b3-1) ...
正在设置 python3.7-minimal (3.7.0~b3-1) ...
正在处理用于 bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) 的触发器 ...
Rebuilding /usr/share/applications/bamf-2.index...
正在处理用于 man-db (2.8.3-2) 的触发器 ...
正在处理用于 gnome-menus (3.13.3-11ubuntu1) 的触发器 ...
正在设置 libpython3.7-stdlib:amd64 (3.7.0~b3-1) ...
正在设置 python3.7 (3.7.0~b3-1) ...
sudo apt-get install python3.7-dbg
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会同时安装下列软件:
libpython3.7-dbg
建议安装:
python3-gdbm-dbg python3-tk-dbg
下列【新】软件包将被安装:
libpython3.7-dbg python3.7-dbg
升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 25.1 MB 的归档。
解压缩后会消耗 86.1 MB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 libpython3.7-dbg amd64 3.7.0~b3-1 [10.9 MB]
获取:1 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 libpython3.7-dbg amd64 3.7.0~b3-1 [10.9 MB]
获取:2 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 python3.7-dbg amd64 3.7.0~b3-1 [14.2 MB]
已下载 23.4 MB,耗时 1分 55秒 (203 kB/s)
正在选中未选择的软件包 libpython3.7-dbg:amd64。
(正在读取数据库 ... 系统当前共安装有 206572 个文件和目录。)
正准备解包 .../libpython3.7-dbg_3.7.0~b3-1_amd64.deb ...
正在解包 libpython3.7-dbg:amd64 (3.7.0~b3-1) ...
正在选中未选择的软件包 python3.7-dbg。
正准备解包 .../python3.7-dbg_3.7.0~b3-1_amd64.deb ...
正在解包 python3.7-dbg (3.7.0~b3-1) ...
正在设置 libpython3.7-dbg:amd64 (3.7.0~b3-1) ...
正在处理用于 libc-bin (2.27-3ubuntu1) 的触发器 ...
正在设置 python3.7-dbg (3.7.0~b3-1) ...
正在处理用于 man-db (2.8.3-2) 的触发器 ...
安装pip:https://bootstrap.pypa.io/get-pip.py
sudo python3.7 get-pip.py
[sudo] dnt 的密码:
The directory '/home/dnt/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/dnt/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pip
Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 1.7MB/s
Collecting wheel
Downloading https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl (41kB)
100% |████████████████████████████████| 51kB 1.0MB/s
Installing collected packages: pip, wheel
Successfully installed pip-18.0 wheel-0.31.1
dnt@MZY-PC:~/下载$ pip
pip pip3 pip3.7
dnt@MZY-PC:~/下载$ pip3.7 -V
pip 18.0 from /usr/local/lib/python3.7/dist-packages/pip (python 3.7)
sudo pip3.7 install pycodestyle
The directory '/home/dnt/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/dnt/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pycodestyle
Downloading https://files.pythonhosted.org/packages/e5/c6/ce130213489969aa58610042dff1d908c25c731c9575af6935c2dfad03aa/pycodestyle-2.4.0-py2.py3-none-any.whl (62kB)
100% |████████████████████████████████| 71kB 144kB/s
Installing collected packages: pycodestyle
Successfully installed pycodestyle-2.4.0
sudo pip3.7 install yapf
The directory '/home/dnt/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/dnt/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting yapf
Downloading https://files.pythonhosted.org/packages/d5/ae/9d2e8f43f2ce467991c8310e361bbf4f1e1bf32afc6441b4e3416685b7ef/yapf-0.22.0-py2.py3-none-any.whl (166kB)
100% |████████████████████████████████| 174kB 495kB/s
Installing collected packages: yapf
Successfully installed yapf-0.22.0
可选安装:apt-get install python3.7-*
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
注意,根据Glob 'python3.7-*' 选中了 'python3.7-2to3'
注意,根据Glob 'python3.7-*' 选中了 'python3.7-tk'
注意,根据Glob 'python3.7-*' 选中了 'python3.7-venv'
注意,根据Glob 'python3.7-*' 选中了 'python3.7-distutils'
注意,根据Glob 'python3.7-*' 选中了 'python3.7-dbg'
注意,根据Glob 'python3.7-*' 选中了 'python3.7-dev'
注意,根据Glob 'python3.7-*' 选中了 'python3.7-doc'
注意,根据Glob 'python3.7-*' 选中了 'python3.7-gdbm'
注意,根据Glob 'python3.7-*' 选中了 'python3.7-minimal'
注意,根据Glob 'python3.7-*' 选中了 'python3.7-lib2to3'
注意,根据Glob 'python3.7-*' 选中了 'python3.7-examples'
注意,选中 'python3-distutils' 而非 'python3.7-distutils'
注意,选中 'python3-gdbm' 而非 'python3.7-gdbm'
注意,选中 'python3-lib2to3' 而非 'python3.7-lib2to3'
注意,选中 'python3-tk' 而非 'python3.7-tk'
python3-distutils 已经是最新版 (3.6.5-3)。
python3-distutils 已设置为手动安装。
python3-gdbm 已经是最新版 (3.6.5-3)。
python3-lib2to3 已经是最新版 (3.6.5-3)。
python3-lib2to3 已设置为手动安装。
python3.7-dbg 已经是最新版 (3.7.0~b3-1)。
python3.7-minimal 已经是最新版 (3.7.0~b3-1)。
python3.7-minimal 已设置为手动安装。
将会同时安装下列软件:
blt javascript-common libexpat1-dev libjs-jquery libjs-underscore
libpython3.7 libpython3.7-dev python-pip-whl tk8.6-blt2.5
建议安装:
blt-demo apache2 | lighttpd | httpd tix python3-tk-dbg
下列【新】软件包将被安装:
blt javascript-common libexpat1-dev libjs-jquery libjs-underscore
libpython3.7 libpython3.7-dev python-pip-whl python3-tk python3.7-dev
python3.7-doc python3.7-examples python3.7-venv tk8.6-blt2.5
升级了 0 个软件包,新安装了 14 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 16.6 MB 的归档。
解压缩后会消耗 78.0 MB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://mirrors.ustc.edu.cn/ubuntu bionic/main amd64 tk8.6-blt2.5 amd64 2.5.3+dfsg-4 [572 kB]
获取:2 http://mirrors.ustc.edu.cn/ubuntu bionic/main amd64 blt amd64 2.5.3+dfsg-4 [4,944 B]
获取:3 http://mirrors.ustc.edu.cn/ubuntu bionic/main amd64 javascript-common all 11 [6,066 B]
获取:4 http://mirrors.ustc.edu.cn/ubuntu bionic/main amd64 libexpat1-dev amd64 2.2.5-3 [122 kB]
获取:5 http://mirrors.ustc.edu.cn/ubuntu bionic/main amd64 libjs-jquery all 3.2.1-1 [152 kB]
获取:6 http://mirrors.ustc.edu.cn/ubuntu bionic/main amd64 libjs-underscore all 1.8.3~dfsg-1 [59.9 kB]
获取:7 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 libpython3.7 amd64 3.7.0~b3-1 [1,507 kB]
获取:8 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 libpython3.7-dev amd64 3.7.0~b3-1 [2,361 kB]
获取:9 http://mirrors.ustc.edu.cn/ubuntu bionic-updates/universe amd64 python-pip-whl all 9.0.1-2.3~ubuntu1 [1,652 kB]
获取:10 http://mirrors.ustc.edu.cn/ubuntu bionic/main amd64 python3-tk amd64 3.6.5-3 [100 kB]
获取:11 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 python3.7-dev amd64 3.7.0~b3-1 [501 kB]
获取:12 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 python3.7-doc all 3.7.0~b3-1 [9,171 kB]
获取:13 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 python3.7-examples all 3.7.0~b3-1 [422 kB]
获取:14 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 python3.7-venv amd64 3.7.0~b3-1 [6,036 B]
已下载 16.6 MB,耗时 24秒 (702 kB/s)
正在选中未选择的软件包 tk8.6-blt2.5。
(正在读取数据库 ... 系统当前共安装有 206847 个文件和目录。)
正准备解包 .../00-tk8.6-blt2.5_2.5.3+dfsg-4_amd64.deb ...
正在解包 tk8.6-blt2.5 (2.5.3+dfsg-4) ...
正在选中未选择的软件包 blt。
正准备解包 .../01-blt_2.5.3+dfsg-4_amd64.deb ...
正在解包 blt (2.5.3+dfsg-4) ...
正在选中未选择的软件包 javascript-common。
正准备解包 .../02-javascript-common_11_all.deb ...
正在解包 javascript-common (11) ...
正在选中未选择的软件包 libexpat1-dev:amd64。
正准备解包 .../03-libexpat1-dev_2.2.5-3_amd64.deb ...
正在解包 libexpat1-dev:amd64 (2.2.5-3) ...
正在选中未选择的软件包 libjs-jquery。
正准备解包 .../04-libjs-jquery_3.2.1-1_all.deb ...
正在解包 libjs-jquery (3.2.1-1) ...
正在选中未选择的软件包 libjs-underscore。
正准备解包 .../05-libjs-underscore_1.8.3~dfsg-1_all.deb ...
正在解包 libjs-underscore (1.8.3~dfsg-1) ...
正在选中未选择的软件包 libpython3.7:amd64。
正准备解包 .../06-libpython3.7_3.7.0~b3-1_amd64.deb ...
正在解包 libpython3.7:amd64 (3.7.0~b3-1) ...
正在选中未选择的软件包 libpython3.7-dev:amd64。
正准备解包 .../07-libpython3.7-dev_3.7.0~b3-1_amd64.deb ...
正在解包 libpython3.7-dev:amd64 (3.7.0~b3-1) ...
正在选中未选择的软件包 python-pip-whl。
正准备解包 .../08-python-pip-whl_9.0.1-2.3~ubuntu1_all.deb ...
正在解包 python-pip-whl (9.0.1-2.3~ubuntu1) ...
正在选中未选择的软件包 python3-tk:amd64。
正准备解包 .../09-python3-tk_3.6.5-3_amd64.deb ...
正在解包 python3-tk:amd64 (3.6.5-3) ...
正在选中未选择的软件包 python3.7-dev。
正准备解包 .../10-python3.7-dev_3.7.0~b3-1_amd64.deb ...
正在解包 python3.7-dev (3.7.0~b3-1) ...
正在选中未选择的软件包 python3.7-doc。
正准备解包 .../11-python3.7-doc_3.7.0~b3-1_all.deb ...
正在解包 python3.7-doc (3.7.0~b3-1) ...
正在选中未选择的软件包 python3.7-examples。
正准备解包 .../12-python3.7-examples_3.7.0~b3-1_all.deb ...
正在解包 python3.7-examples (3.7.0~b3-1) ...
正在选中未选择的软件包 python3.7-venv。
正准备解包 .../13-python3.7-venv_3.7.0~b3-1_amd64.deb ...
正在解包 python3.7-venv (3.7.0~b3-1) ...
正在设置 libjs-jquery (3.2.1-1) ...
正在设置 python-pip-whl (9.0.1-2.3~ubuntu1) ...
正在设置 libjs-underscore (1.8.3~dfsg-1) ...
正在处理用于 install-info (6.5.0.dfsg.1-2) 的触发器 ...
正在设置 python3.7-venv (3.7.0~b3-1) ...
正在设置 python3.7-examples (3.7.0~b3-1) ...
正在处理用于 libc-bin (2.27-3ubuntu1) 的触发器 ...
正在设置 tk8.6-blt2.5 (2.5.3+dfsg-4) ...
正在设置 libpython3.7:amd64 (3.7.0~b3-1) ...
正在处理用于 doc-base (0.10.8) 的触发器 ...
Processing 9 added doc-base files...
正在设置 libexpat1-dev:amd64 (2.2.5-3) ...
正在处理用于 man-db (2.8.3-2) 的触发器 ...
正在设置 javascript-common (11) ...
正在设置 python3.7-doc (3.7.0~b3-1) ...
正在设置 blt (2.5.3+dfsg-4) ...
正在设置 libpython3.7-dev:amd64 (3.7.0~b3-1) ...
正在设置 python3-tk:amd64 (3.6.5-3) ...
正在设置 python3.7-dev (3.7.0~b3-1) ...
正在处理用于 libc-bin (2.27-3ubuntu1) 的触发器 ...
vscode设置python3.7调试环境(已更新)的更多相关文章
- 将VSCode设置成中文语言环境
VSCode是一款轻量级的好用的编译软件,今天小编来将软件默认的英文语言环境变为我们熟悉的中文语言环境. 工具/原料 电脑一台 安装有VSCode 方法/步骤 首先打开VSCode软件,可 ...
- vscode+phpstudy构建php调试环境
由于vs code开源和跨平台,而且插件很多,所以打算以后编写和调试php都用vs code. 配置vs code+phpstudy的php调试环境步骤如下: 1.配置phpstudy,其他选项菜单- ...
- vscode设置VUE eslint开发环境
我的使用vscode开发VUE的常用设置 1.安装插件 ESLint Vetur Beautify Prettier - Code formatter Auto Rename Tag -重命名标签,闭 ...
- Windbg双机调试环境配置(Windows7/Windows XP+VirtualBox/VMware+WDK7600)
简介:Windbg双机调试内核.驱动 下载软件: 下载Windbg(GRMWDK_EN_7600_1.ISO) 下载VirtualBox 5.2/VMware 12 一.安装WDK,这里要提一点的是D ...
- 玩转VSCode-完整构建VSCode开发调试环境
随着VSCode的不断完善和强大,是时候将部分开发迁移到VS Code中了. 目前使用VS2019开发.NET Core应用,一直有一个想法,在VS Code中复刻VS的开发环境,同时迁移到VS Co ...
- 使用 VSCode 在 Mac 上配置 C/C++ 调试环境
Background VSCode是微软开发的一款开源代码编辑器,具有可拓展性强,多语言支持,跨平台等优点,在不同的个性化配置下几乎可以用作所有的轻量级开发.我在初学C的时候也使用的是类似于Xcode ...
- VSCode配置python调试环境
VSCode配置python调试环境 很久之前的一个东东,翻出来看看 VSCode配置python调试环境 * 1.下载python解释器 * 2.在VSCode市场中安装Python插件 * 4.在 ...
- Blackey win10 + python3.6 + VSCode + tensorflow-gpu + keras + cuda8 + cuDN6N环境配置(转载)
win10 + python3.6 + VSCode + tensorflow-gpu + keras + cuda8 + cuDN6N环境配置 写在前面的话: 再弄这个之前,我对python也好 ...
- vscode加MinGw三步搭建c/c++调试环境
vscode加MinGw三步搭建c/c++调试环境 step1:安装vscode.MinGw 1.1 vscod常规安装:https://code.visualstudio.com/ 1.2 MinG ...
随机推荐
- SpringBoot集成mybatis配置
一个有趣的现象:传统企业大都喜欢使用hibernate,互联网行业通常使用mybatis:之所以出现这个问题感觉与对应的业务有关,比方说,互联网的业务更加的复杂,更加需要进行灵活性的处理,所以myba ...
- Flask框架搭建REST-API服务
一.目的 为了能够将测试工具部署成RESTful-API服务,这样就能通过接口的方式提供统一测试工具服务,使用人员就不用构建application而产生的各种环境问题.使用问题. 适合人群:Pytho ...
- Kotlin入门(32)网络接口访问
手机上的资源毕竟有限,为了获取更丰富的信息,就得到辽阔的互联网大海上冲浪.对于App自身,也要经常与服务器交互,以便获取最新的数据显示到界面上.这个客户端与服务端之间的信息交互,基本使用HTTP协议进 ...
- [Python][Scrapy 框架] Python3 Scrapy的安装
1.方法(只介绍 pip 方式安装) PS.不清楚 pip(easy_install) 可以百度或留言. cmd命令: (直接可以 pip,而不用跳转到 pip.exe目录下,是因为把所在目录加入 P ...
- jenkins自动化工具使用教程(转)
自动化构建.测试.部署.代码检测越来越重要.主要有一下几点原因 企业做大,项目变多,多端支持(web,h5,小程序等) 微服务提倡高内聚低耦合,项目因拆分变多 DevOps自动化运维流行 集群化,高可 ...
- Ubuntu 16.04 启用 点击Launcher图标,窗口实现最小化 功能
安装了Ubuntu之后,要是每次都点击最小化按钮来实现窗口的最小化,操作起来很不方便,那么怎么样才能方便操作呢, Ubuntu 16.04 本身支持 点击应用程序Launcher图标实现最小化 功能, ...
- 使用mybatis操作AS400数据库
先简单说一下怎么使用[jt400.jar]连接AS400上的DB2数据库. ※ jt400.jar资源,如果有安装AS400客户端的话,参考IBM官网 ※ http://www-01.ibm.com/ ...
- vue 路由变化页面数据不刷新问题(缓存)
每天记录一点点,把我遇到的问题记录下来, 希望可以帮助到更多和我遇到同样问题的人. 问题描述:通过调接口,动态显示帮助页面的问题列表, 问题列表有多级,当点击的这个问题没有下一级问题的时候跳入内容页. ...
- java 项目打jar包,用cmd运行,并且编写运行脚本
项目是ideal编辑器的springboot项目的demo.打包就是在侧边栏,点击packge ,就会在target下生成jar包. 生成之后把 jar包放在一个文件夹中.新建一个txt文件,在txt ...
- day10-内置模块学习(一)
今日份目录 1.模块之间的相互调用 2.代码结构的标准化 3.os模块 4.sys模块 5.collection模块 开始今日份总结 开始今日份总结 1.模块之间的相互调用 由于一些原因,总是会调用别 ...