汇总系列: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调试环境(已更新)的更多相关文章

  1. 将VSCode设置成中文语言环境

    VSCode是一款轻量级的好用的编译软件,今天小编来将软件默认的英文语言环境变为我们熟悉的中文语言环境. 工具/原料   电脑一台 安装有VSCode 方法/步骤     首先打开VSCode软件,可 ...

  2. vscode+phpstudy构建php调试环境

    由于vs code开源和跨平台,而且插件很多,所以打算以后编写和调试php都用vs code. 配置vs code+phpstudy的php调试环境步骤如下: 1.配置phpstudy,其他选项菜单- ...

  3. vscode设置VUE eslint开发环境

    我的使用vscode开发VUE的常用设置 1.安装插件 ESLint Vetur Beautify Prettier - Code formatter Auto Rename Tag -重命名标签,闭 ...

  4. Windbg双机调试环境配置(Windows7/Windows XP+VirtualBox/VMware+WDK7600)

    简介:Windbg双机调试内核.驱动 下载软件: 下载Windbg(GRMWDK_EN_7600_1.ISO) 下载VirtualBox 5.2/VMware 12 一.安装WDK,这里要提一点的是D ...

  5. 玩转VSCode-完整构建VSCode开发调试环境

    随着VSCode的不断完善和强大,是时候将部分开发迁移到VS Code中了. 目前使用VS2019开发.NET Core应用,一直有一个想法,在VS Code中复刻VS的开发环境,同时迁移到VS Co ...

  6. 使用 VSCode 在 Mac 上配置 C/C++ 调试环境

    Background VSCode是微软开发的一款开源代码编辑器,具有可拓展性强,多语言支持,跨平台等优点,在不同的个性化配置下几乎可以用作所有的轻量级开发.我在初学C的时候也使用的是类似于Xcode ...

  7. VSCode配置python调试环境

    VSCode配置python调试环境 很久之前的一个东东,翻出来看看 VSCode配置python调试环境 * 1.下载python解释器 * 2.在VSCode市场中安装Python插件 * 4.在 ...

  8. Blackey win10 + python3.6 + VSCode + tensorflow-gpu + keras + cuda8 + cuDN6N环境配置(转载)

    win10 + python3.6 + VSCode + tensorflow-gpu + keras + cuda8 + cuDN6N环境配置   写在前面的话: 再弄这个之前,我对python也好 ...

  9. vscode加MinGw三步搭建c/c++调试环境

    vscode加MinGw三步搭建c/c++调试环境 step1:安装vscode.MinGw 1.1 vscod常规安装:https://code.visualstudio.com/ 1.2 MinG ...

随机推荐

  1. 转一篇OpenSSL的例子:简单的TLS服务器

    原名:Simple TLS Server 原址:https://wiki.openssl.org/index.php/Simple_TLS_Server Windows下就不要从源码编译OpenSSL ...

  2. 网上都没有提到的教程:python捕获异常后,怎么输出错误文件和行号

    1.假设输出不存在的变量 a try: print(a) except NameError as e: print('发生错误的文件:', e.__traceback__.tb_frame.f_glo ...

  3. sqlmap 基本应用

    sqlmap 基本应用: sqlmap详细命令: -is-dba 当前用户权限(是否为root权限) -dbs 所有数据库 -current-db 网站当前数据库 -users 所有数据库用户 -cu ...

  4. socket接收大数据流

    客户端: import socket client = socket.socket() client.connect(("127.0.0.1", 9999)) while True ...

  5. vue 组件开发、vue自动化工具、axios使用与router的使用(3)

    一. 组件化开发 1.1 组件[component] 在网页中实现一个功能,需要使用html定义功能的内容结构,使用css声明功能的外观样式,还要使用js定义功能的特效,因此就产生了一个功能先关的代码 ...

  6. C#基础知识之特性

    一.什么是特性 个人理解:特性本质上也是有一种类,通过添加特性,就可以实例化这个特性类:添加特性就是在类.方法.结构.枚举.组件等上面加一个标签,使这些类.方法.结构.枚举.组件等具有某些统一的特征, ...

  7. vue-router(hash模式)常见问题以及解决方法

    问题一:// 动态路由/detail/:id 问题:动态路由跳转的时候,页面是不刷新的,相信很多人都遇到了相同的问题解决方法:在全局的router-view组件上设置一个key值,此key值为一个时间 ...

  8. vue_ui使用

    cnpm install -g @vue/cli 下载 vue -V 查看版本 vue ui 运行vue ui 这样在浏览器上就能看到vue图形界面 根据需求设置

  9. web框架开发-Django模型层(1)之ORM简介和单表操作

    ORM简介 不需要使用pymysql的硬编码方式,在py文件中写sql语句,提供更简便,更上层的接口,数据迁移方便(有转换的引擎,方便迁移到不同的数据库平台)…(很多优点),缺点,因为多了转换环节,效 ...

  10. 20145203盖泽双《网络对抗技术》拓展:注入:shellcode及return-into-libc攻击

    20145203盖泽双<网络对抗技术>拓展:注入:shellcode及return-into-libc攻击 一.注入:shellcode 1.编写一段用于获取Shellcode的C语言代码 ...