在ubuntu系统下安装python

编程知识 更新时间:2023-04-08 01:42:11

一、背景介绍

随着本人python使用的越来越多,跑的代码和程序越来越复杂,从git下载代码也更多的需要liux系统才能使用,所以考虑在ubuntu系统下安装python,此博文也是基于CSDN7天培训的一些需要去做的,更多的方便记录安装流程以及出现问题的解决方案。
首先需要安装ubuntu系统,具体软件请参考博客:https://blog.csdn/wp215501547/article/details/103665646

二、安装docker

2.1 docker是什么?

Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的镜像中,然后发布到任何流行的 Linux或Windows 机器上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口(百度搜索结果,也是不太理解,先安装再说)

2.1安装crul

为了安装docker,需要安装crul,命令如下:

sudo apt install curl

但是报错了

解决方案:

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock

2.2安装docker

安装docker命令如下:

curl -sSL https://get.daocloud.io/docker | sh

2.3测试 Docker 是否安装成功

输入以下指令,打印出以下信息则安装成功:

$ sudo docker run hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete                                                                                                                                  Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
Status: Downloaded newer image for hello-world:latest


Hello from Docker!
This message shows that your installation appears to be working correctly.


To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.


To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash


Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker/


For more examples and ideas, visit:
 https://docs.docker/get-started/

三、安装python

3.1 python安装命令

命令行中输入sudo passwd ,输入密码,进入超级管理员模式
在系统中,打开终端命令行,按下面代码一行行输入即可

sudo apt-get install python
sudo apt-get install python-dev
sudo apt-get install python-pip
sudo apt-get install libxml*
sudo apt-get install net-tools
sudo apt-get install lsof

完成之后,在命令行中输入python3,结果如下,表示安装完成

3.2 python测试

命令行输入python,进行测试

四、安装pycharm

3.1 pycharm安装

1.下载安装包

网址:https://www.jetbrains/pycharm/download/#section=linux
选择对应的版本和系统就可以

2.解压

下载后找到下载文件,选择Extract Here,解压到当前,目录

3.安装

使用cd命令,进入解压好的文件夹,进入bin文件夹,对应的文件路径,运行sh ./pycharm.sh,按步骤操作就可以。

3.2 pycharm显示

五、安装anacnoda

5.1 anacnoda是什么

Anaconda指的是一个开源的Python发行版本,其包含了conda、Python等180多个科学包及其依赖项。因为包含了大量的科学包,Anaconda 的下载文件比较大(约 531 MB),如果只需要某些包,或者需要节省带宽或存储空间,也可以使用Miniconda这个较小的发行版(仅包含conda和 Python)。

5.2 anacnoda安装

1.清华大学开源软件镜像站下载https://mirrors.tuna.tsinghua.edu/help/anaconda/
2.选择合适的版本下载
3.找到对应的文件
4.命令行输入指令

bash Anaconda3-5.2.0-Linux-x86_64.sh
注意版本

5.遇到提示,输入yes,然后回车

5.3 anacnoda.navigator

参考博客:

[1]https://www.runoob/docker/ubuntu-docker-install.html
[2]https://blog.csdn/xinyan233/article/details/80369061
[3]https://blog.csdn/zhuanshu666/article/details/73554885
[4]https://jingyan.baidu/article/c45ad29c030102051753e20f.html
[5]https://blog.csdn/x1987200567/article/details/104348055

更多推荐

在ubuntu系统下安装python

本文发布于:2023-04-08 01:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/38a95e03f3b7b0ea3ec7a26b4a171929.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:系统   ubuntu   python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 55393文章数
  • 14阅读数
  • 0评论数