当前位置: 首页 > news >正文

windows 安装Linux子系统 Ubuntu 并配置python3

环境说明:

Windows 11   Ubuntu 20.04.6

安装步骤以及问题:

1、开启Windows Subsystem for Linux

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

2、开启虚拟机特性

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

3、下载并安装WSL2更新包

https://link.zhihu.com/?target=https%3A//wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

4、将WSL2设置成默认

wsl --set-default-version 2

注:以上命令均以powershell的管理员命令执行

若未执行以上命令,直接安装Linux子系统,会出现如下报错:

5、打开Microsoft store 获取(我已经安装,所以是打开,未安装则显示获取)

6、打开软件

配置用户名和密码,到此,安装结束

7、配置国内安装源(加快系统包安装速度)

备份配置文件:sudo cp /etc/apt/sources.list /etc/apt/sources_bk.list

修改配置文件:vim /etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

将上述内容覆盖即可,

8、更新系统包列表

sudo apt update

默认情况下,Ubuntu 20.04初始安装python3.8.10,但是未安装pip3

9、安装pip3

sudo apt install python3-pip

此处,结束 20230920


文章转载自:
http://acaudal.tmizpp.cn
http://cataplexy.tmizpp.cn
http://after.tmizpp.cn
http://budgeree.tmizpp.cn
http://blesbuck.tmizpp.cn
http://animadvert.tmizpp.cn
http://ahvaz.tmizpp.cn
http://apennine.tmizpp.cn
http://campanulate.tmizpp.cn
http://asexuality.tmizpp.cn
http://chilidog.tmizpp.cn
http://butterbur.tmizpp.cn
http://breechblock.tmizpp.cn
http://breathe.tmizpp.cn
http://bismuthic.tmizpp.cn
http://auriculate.tmizpp.cn
http://cadastral.tmizpp.cn
http://anisette.tmizpp.cn
http://bantingism.tmizpp.cn
http://buna.tmizpp.cn
http://acquiescent.tmizpp.cn
http://amharic.tmizpp.cn
http://catenulate.tmizpp.cn
http://cerebrate.tmizpp.cn
http://boreal.tmizpp.cn
http://bucktail.tmizpp.cn
http://asexuality.tmizpp.cn
http://caretake.tmizpp.cn
http://avigation.tmizpp.cn
http://archduchess.tmizpp.cn
http://www.dtcms.com/a/1588.html

相关文章:

  • 你需要知道DDD基本知识
  • GoAccess实时分析Nginx日志
  • Python批量统计pdf中“中文”字符的个数
  • C 初级学习笔记(基础)
  • Python之列表
  • java实现力扣计算器
  • Nginx 解决内容安全策略CSP(Content-Security-Policy)配置方式
  • Leetcode55. 跳跃游戏
  • 基于若依ruoyi-nbcio增加flowable流程待办消息的提醒,并提供右上角的红字数字提醒(八)
  • StartUML 5.1.0文本框中文自动换行和排版问题解决
  • Python:Django框架的Hello wrold示例
  • matlab读写json文件
  • unity自己对象池的使用
  • CHAPTER 10: DESIGN A NOTIFICATION SYSTEM
  • C/C++统计满足条件的4位数个数 2023年5月电子学会青少年软件编程(C/C++)等级考试一级真题答案解析
  • python装13的一些写法
  • flume安装及实战
  • 数据库选型参考
  • 数据分享|R语言生态学种群空间点格局分析:聚类泊松点过程对植物、蚂蚁巢穴分布数据可视化...
  • 【Linux】Linux环境基础开发工具使用
  • 多线程带来的的风险-线程安全
  • MySQL集群高可用架构之MMM
  • 设计模式-代理模式
  • 【python爬虫】—星巴克产品
  • 【C语言】指针经典笔试题(上)
  • [Linux入门]---git命令行的基本使用
  • pytorch生成CAM热力图-单张图像
  • Python实现简单的爬虫功能
  • CListCtrl设置只显示单列
  • RabbitMQ配置文件_修改RabbitMQ MQTT的1883端口