vscode怎么安装python插件包,vscode安装python插件出错

这篇文章主要介绍了如何安装vscode并配置python环境,具有一定借鉴价值,需要的朋友可以参考下。希望大家阅读完这篇文章后大有收获,下面让小编带着大家一起了解一下。

大家好,小编来为大家解答以下问题,如何安装vscode并配置python环境,vscode安装python插件后怎么用,现在让我们一起来看看吧!

Visual Studio Code - Python Install - Packages

新的笔记本装机,大家都在用 VS Code,试试

  1. 安装VS Code ,看看能支持的最新的Python 版本;
  2. 安装 python 3.7.3;
  3. VS Code 中 Menu 选 View -> Extensions (Ctrl+Shitf+X) ; 打开extension 的窗口 ;
  4. 搜索 Python 并且 安装 ,后面就会有 MS-python 的安装指导 ,Install
  5. VSCode updated 1.58.2 (pylance) Select an interpreter 使用 Python: Select Interpreter 设置 python 的安装目录
常用的whm 和 Plugin

open the TERMINAL window
go to the PS C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\s>
目前 Python 升级 pip 以后会 提示 使用 python -m pip 取代原有的pip
回到 Python 目录下 (Python37_64)

python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple flask-mail
-i 后面跟的是 国内的 python simple 库的 url, 有效防止install time-out 的问题
清华: https://pypi.tuna.tsinghua.edu.cn/simple
阿里: https://mirrors.aliyun.com/pypi/simple
如果提示 权限有问题可以试试 加上 --user

解决SSLError
ErrorSSLError
在pip install 上加上 --trusted-host pypi.tuna.tsinghua.edu.cn

通常的安装目录:
C:\Users\{{USER}}\AppData\Roaming\Python\Python37\site-packages\
C:\Users\{{USER}}\AppData\Local\Programs\Python\Python38\Lib\site-packages

  1. Excel https://openpyxl.readthedocs.io/en/stable/
    .\pip install --user openpyxl
  2. Jupyter Notebook - install jupyter
  3. FASTAPI “C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe” -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple fastapi --user
  4. UVICORN “C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe” -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple uvicorn --user
  5. BaseModel “C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe” -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple BaseModel --user
  6. simplexml "C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe" -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple python-simplexml --user
  7. MongoDB “C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe” -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pymongo --user
  8. records “C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe” -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple records --user
  9. MYSQL-Connector python.exe -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple mysql-connector-python --user
  10. mysql (import MySQLdb) pip install mysql
    使用 import mysql.connector
    一定要记得按装 mysql 的 mysql-python-connector。 否则python import 就会报错:pylint import error;或者会报 mysql.connector.errors.NotSupportedError
    mysql-python-connector download
  11. pymysql pip install pymysql
  12. BeautifulSoup python.exe -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple BeautifulSoup4 --user(BeautifulSoup is an very old version, need to install BeautifulSoup4)
  13. Selenium: python.exe -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple selenium --user (如果没有装wheel,会提示装wheel) (ChromeDriverFireFoxDriver ) (ChromeDriver 要放到Python.exe 所在目录下)
  14. WHEEL: python.exe -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple wheel --user
  15. pandas-profiling: 三行 code 生产数据 report, - install pandas-profiling.
    Windows 上 打开 CMD 使用 where pandas-profiling 找到安装目录,找到父目录下的site-package/pandas-profiling 文件夹,找到配置文件 .yaml
  16. Gensim:最好先查看一下 scipy 和 numpy 的版本,或者先uninstall 这两兄弟python有趣作品python创意作品。然后再安装
    "C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/python.exe" -m pip install gensim -i https://pypi.tuna.tsinghua.edu.cn/simple --user
  17. Jieba (结巴)Jieba on Git
  18. SnowNLP SnowNLP on Git
  19. THULAC THULAC on Git
  20. NLPIR: pip install pynlpir NLPIR on Git
  21. PKUseg: PKUseg on Git
  22. NLTK: pip install nltk
  23. HanLP: HanLP on Git
  24. Pyecharts Pyecharts intro
    文件所在的包,可能会更新哟,注意Import 的路径
    python_package_update
    Pyecharts on Github
    实例 地图实例
  25. mplfinance mplfinance on pypi
  26. XML to Dict :转XML到JSON python.exe -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xmltodict
  27. Logging python.exe -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple logging
  28. 地理编码 geopy pip install geopy
  29. fbjson2table fbjson2table on Pypi.org pip install fbjson2table
  30. tabulate console 输出表格 pip install tabulate
  31. torch "C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/python.exe" -m pip install torch -i https://pypi.tuna.tsinghua.edu.cn/simple
    如果使用cuda,需要去 pytorch 的官网,来选择安装工具,根据提示来生成安装命令
    pytorchInstallCMDline
  32. pandasgui 依赖于 PyQt "C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/python.exe" -m pip install pandasgui -i https://pypi.tuna.tsinghua.edu.cn/simple
  33. pywin32 pip install pypiwin32 -i https://pypi.tuna.tsinghua.edu.cn/simple
    ModuleNotFoundError: No module named ‘win32api’
  34. paddle: initial Install: common, dual, tight, data for paddle
  35. cv2: import cv2: pip install opencv-python
  36. Scrapy: pip install scrapy
    install scrapy
    Scrapy 教程
    Scrapy详解之Response
  37. Dash:
    Dash Install
  38. PySimpleGUI pip install pySimpleGUI
    Install demo: pip install psgdemos
    CMD Line: psgdemos 启动 DEMO 例子
    demo: Demo_All_Elements_Simple.py
  39. Could not find a version that satisfies the requirement jaxlib ==> StackOverflow: Thanks to cloudhan’s jax-windows-builder, it is now rather easy to install JAX and jaxlib on windows. E.g. pip install jax==0.3.13 https://whls.blob.core.windows.net/unstable/cuda111/jaxlib-0.3.7+cuda11.cudnn82-cp38-none-win_amd64.whl
  40. redis pip install python-redis
  • 使用 requirements.txt "C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/python.exe" -m pip install -r "D:/workspace/MyPy/TEST/requirements.txt" -i https://pypi.tuna.tsinghua.edu.cn/simple --user
n_freq_table_max: 10 # 更改Variable下面,每个变量显示的最大参数个数
  • 目前可以看到 VS Code 按照插件时的 命令如下: “C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/python.exe” -m pip install -U pylint --user

  • Add Python install folder into WINDOW PATH -> 编辑系统环境变量
    WIN10 PathAddpythonDIR

Python Import

python中用import导入包的机制原理是什么

Jupyter

git clone https://github.com/ipython/ipython-in-depth

Start Jupyter in Command Window

jupyter notebook

查看jupyter配置文件

jupyter notebook --generate-config

Jupyter Notebook修改默认的工作目录
jupyter安装步骤
jupyter使用

MySQL

pymysql出现Warning:1366的解决办法

SQLAlchemy

Python之Mysql及SQLAlchemy操作总结
sqlalchemy 原生sql查询 返回字典形式数据
SQLAlchemy映射已有数据表
sqlalchemy批量插入
sqlalchemy批量插入数据(性能问题)

Thread and Process

python线程池ThreadPoolExecutor与进程池ProcessPoolExecutor
Python 并发编程:PoolExecutor 篇

  1. 任务通过 executor.submit 提交到 executor 的任务队列,返回一个 future 对象。=> Future 是常见的一种并发设计模式。一个Future对象代表了一些尚未就绪(完成)的结果,在「将来」的某个时间就绪了之后就可以获取到这个结果。
  2. 任务被调度到各个 workers 中执行。但是要注意,一个任务一旦被执行,在执行完毕前,会一直占用该 worker!=> 如果 workers 不够用,其他的任务会一直等待!因此 PoolExecutor 不适合实时任务。
  • add_done_callback(fn):future 完成后,会执行 fn(future)
future = executor.submit(funciton, args)
future.add_done_callback(callback_function)
FASTAPI
  • CAUTIONS:
    • 生产环境部署时,注意:host=‘0.0.0.0’
    • gunicorn (守护进程让fastapi一直运行着)py -m pip install gunicorn --user
      安装目录: C:\Users\Administrator\AppData\Roaming\Python\Python37\Scripts,
      gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker
      FAILED TO START due to no fcntl
      FAILED TO Indstall fcntl: py -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple micropython-fcntl --user

FastAPI official site
FastApi应用和部署生产环境
uvicorn support the FastAPI
从零开始学FastAPI(1)-简明的部分官方文档抽取学习篇
FastApi教程|直接返回响应

HHTP request/response with application-content = text/xml

MongoDB

MongoDB Basic Usage 应用

FLASK

Python Flask Web 框架入门

Flask-Babel

Flask-Babel使用简易教程(一)
pybabel --list-locales 命令,查看本机支持的语言

Gensim

Gensim Word2vec
Gensim Core Concepts
Gensim Doc2vec
在Python上怎么也用不了的 gensim(IDE VScode)
训练Word2Vec报错:RuntimeError: you must first build vocabulary before training the model
python中gensim库详解
gensim实现python对word2vec的训练和计算 ==> 一些word2vec模型的查询方法
机器学习算法Python实现:doc2vec 求句子相似度
gensim Word2Vec 训练和使用(Model一定要加载到内存中,节省时间!!!)

分词

自然语言处理入门(4)——中文分词原理及分词工具介绍
Thulac

Loggin 日志

PYTHON 之 LOG日志
Python之日志处理(logging模块)
Python Logger使用 -> Log Class
python处理logger日志 -->Log Method

MPIFinance

mplfinance tutorials
Python的mpl_finance模块从2020年已经提醒弃用,新mplfinance模块详解(一)

fbjson2tabel
  • get the json format using 查看产生的表的结构和字段名字
from fbjson2table.func_lib import parse_fb_json
from fbjson2table.table_class import TempDFs
json_content = parse_fb_json($PATH_OF_JSON)
temp_dfs = TempDFs(json_content)
for df in temp_dfs.df_list:
    print(df)
  • get detail view of the tables
Scrapy

Python爬虫系列:Scrapy爬取实例(End~)
create project folder
create a project scrapy startproject test
scrapyStartproject
进入proj1 目录,使用template生成spider 文件
scrapyGenspider
进入目录里下面的 spiders 目录,找到刚才用 scrapy gensider 时使用的名字生成的 stocks.py
proj1\proj1\spiders\proj.py

start_urls = ['https://www.xyz.com/aaa/1.html'] # 设置初始的 URL

进入 spiders 文件夹,使用 scrapy runspider "D:/tttt/ttttt/abcd.py" -O quotes.json来测试
scrapy runspider in VScode on WIN10(Enterprise) 找不到下载的output 文件

输出文件用 UTF8 编码
通过执行scrapy crawl spidername -o filename.json输出到文件
此时仅需要在工程的根目录下setting.py文件中设置:FEED_EXPORT_ENCODING = ‘utf-8’

CUDA
install

CUDA安装教程(超详细)
一定要装cuDNN
Package | 解决 Windows10 Anaconda环境 CUDA11.5 pytorch运行报错 No CUDA runtime is found

CUDA Error handling
pandas-profiling

official site
change settings
default_config_example

TensorFlow
Study

tensor flow install
基本分类:对服装图像进行分类

关于编译
Microsoft
Visual Code Studio

VS2017下载地址和安装教程(图解)

MSVC

MSVC编译器中的_MSC_VER如何使用?

Reference
  • 15
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值