首页 > 编程语言 >vscode编写python

vscode编写python

时间:2024-03-09 10:56:54浏览次数:30  
标签:00 mirrors vscode anaconda python tsinghua https edu 编写

  • 安装插件

  • 打开cmd创建虚拟环境

C:\Users\ychen>conda create -n env_dev python=3.10.4
Fetching package metadata .................
Solving package specifications: .

Package plan for installation in environment C:\ProgramData\Anaconda3\envs\env_dev:

The following NEW packages will be INSTALLED:

    bzip2:           1.0.8-h2bbff1b_5       https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    ca-certificates: 2023.12.12-haa95532_0  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    libffi:          3.4.4-hd77b12b_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    openssl:         1.1.1w-h2bbff1b_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    pip:             23.3.1-py310haa95532_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    python:          3.10.4-hbb2ffb3_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    setuptools:      68.2.2-py310haa95532_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    sqlite:          3.41.2-h2bbff1b_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    tk:              8.6.12-h2bbff1b_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    tzdata:          2024a-h04d1e81_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    vc:              14.2-h21ff451_1        https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    vs2015_runtime:  14.27.29016-h5e58377_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    wheel:           0.41.2-py310haa95532_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    xz:              5.4.6-h8cc25b3_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    zlib:            1.2.13-h8cc25b3_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

Proceed ([y]/n)? y

tzdata-2024a-h 100% |###############################| Time: 0:00:00 615.02 kB/s
bzip2-1.0.8-h2 100% |###############################| Time: 0:00:00   3.09 MB/s
tk-8.6.12-h2bb 100% |###############################| Time: 0:00:00   7.38 MB/s
xz-5.4.6-h8cc2 100% |###############################| Time: 0:00:00  12.65 MB/s
zlib-1.2.13-h8 100% |###############################| Time: 0:00:00   8.77 MB/s
python-3.10.4- 100% |###############################| Time: 0:00:01  11.20 MB/s
setuptools-68. 100% |###############################| Time: 0:00:00  11.79 MB/s
wheel-0.41.2-p 100% |###############################| Time: 0:00:00   0.00  B/s
pip-23.3.1-py3 100% |###############################| Time: 0:00:00  11.51 MB/s
#
# To activate this environment, use:
# > activate env_dev
#
# To deactivate an active environment, use:
# > deactivate
#
# * for power-users using bash, you must source
#


C:\Users\ychen>conda info -e
# conda environments:
#
env_dev                  C:\ProgramData\Anaconda3\envs\env_dev
root                  *  C:\ProgramData\Anaconda3


C:\Users\ychen>activate env_dev

(env_dev) C:\Users\ychen>pip list
Package    Version
---------- -------
pip        23.3.1
setuptools 68.2.2
wheel      0.41.2

(env_dev) C:\Users\ychen>pip install Numpy
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting Numpy
  Downloading https://mirrors.aliyun.com/pypi/packages/19/77/538f202862b9183f54108557bfda67e17603fc560c384559e769321c9d92/numpy-1.26.4-cp310-cp310-win_amd64.whl (15.8 MB)
     ---------------------------------------- 15.8/15.8 MB 10.1 MB/s eta 0:00:00
Installing collected packages: Numpy
Successfully installed Numpy-1.26.4

(env_dev) C:\Users\ychen>pip list
Package    Version
---------- -------
numpy      1.26.4
pip        23.3.1
setuptools 68.2.2
wheel      0.41.2
  • 打开1个文件夹作为项目文件夹
  • Ctrl+P打开命名面板,输入如下命令
> select interpreter
  • 选择解释器

  • 选择虚拟环境

  • 右下角也可以选择

  • 点击右上角执行

标签:00,mirrors,vscode,anaconda,python,tsinghua,https,edu,编写
From: https://www.cnblogs.com/dogleftover/p/18062371

相关文章

  • python面向对象(一)
    面向对象(ObjectOrientedProgram)在Python中,所有的数据(包括数字和字符串)实际都是对象,同一类型的对象都有相同的类型。我们可以使用type()函数来获取关于对象的类型信息。什么是类,什么是对象?在Python中,使用类来定义同一种类型的对象。类(class)是广义的数据类型,能够定义复......
  • python迭代器、生成器与可迭代对象
    迭代(Iteration)如果给定一个list或tuple,我们可以通过for循环来遍历这个list或tuple,这种遍历我们称为迭代(Iteration),这些可以直接作用于for循环的对象统称为可迭代对象:Iterable方法是通过collections.abc模块的Iterable类型判断,一个对象是否为可迭代对象>>>fromcollections.......
  • eclipse编写html
    Windows—>Perspective—>CustommizePerspectiveShortcuts->WebFile->New—>StaticWebProject输入名称自定义文件夹名称创建html文件指定名称选择版本新建文件夹,存放图片......
  • 用lazarus编写的类RichView显示控件初步支持markdown格式的表格,并增加单元格字体颜色
    用lazarus编写的类RichView显示控件初步支持markdown格式的表格,并增加单元格字体颜色等功能,可在信创电脑使用,功能慢慢添加中。github:https://github.com/szlbz/QFComponent其中图像格式支持:bmp,jpg,png等 除以上格式外,还支持单、双分割线等......
  • python urllib.parse urlparse path url路径分割
    前言全局说明pythonurllib.parseurlparsepathurl路径分割一、获取路径部分#!/usr/bin/envpython3#coding:UTF-8#-*-coding:UTF-8-*-fromurllib.parseimporturlparseurl='http://www.baidu.com/aa/bb/cc/index.html'print("url:",url)parsed......
  • Python
    内置函数str=“a,b,b,d,e,f”1.len()表示字符串长度2.find()表示检查字符串中是否包含某个子字符串,如果包含则返回字符串对应的索引值,如果不包含则返回-1语法:(substr,start,end)3.index()表示检测字符串中是否包含子字符串,如果找不到会报错。4.count()用于统计某个字符串出现的......
  • 编写kickstart脚本,执行时遇到的问题
    KickStart脚本#!/bin/bash#declarevaryum_ins="yum-yinstall"sys_res="systemctlrestart"#1.配置dhcpdhcp_cfg(){#declaredhcp_vardhcp_path="/etc/dhcp"dhcp_conf=$dhcp_path/dhcpd.conf#网段net_seg="......
  • python的ansible库--ansible_runner
    介绍AnsibleRunner是ansible官方提供的一个工具和python库,当直接与Ansible进行交互或作为另一个系统的一部分与Ansible进行交互时,无论是通过容器映像接口,作为独立工具还是作为可以导入的Python模块,它都可以提供帮助。目的是为Ansible提供稳定且一致的接口抽象。参考网站[官方......
  • python 脚本中 # -*- coding: utf-8 -*-的作用
     001、[root@pc1test1]#lstest01.pytest02.py[root@pc1test1]#cattest01.py#!/usr/bin/envpython#注释内容list1=["aa","bb","cc"]print(list1)[root@pc1test1]#cattest02.py#!/usr/bin/envpython#-*-coding:utf-8......
  • python3.7.4 RV1126 交叉编译
    首先,十分感谢大佬分享的交叉编译攻略,原文链接如下:https://www.cnblogs.com/Se7eN-HOU/p/16736164.html在此基础上,本人经过一周时间的踩坑,终于在RV1126开发板上实现了交叉编译。现记录本人实际编译版本与上述版本略有不同之处。主要是由于3.5.2版本的python和openssl1.0.2g在......