ubuntu安装python pip_anaconda pipenv

ubuntu安装python pip_anaconda pipenv简单介绍在Ubuntu上安装Python的virtualenv前提:本机安装了Linux系统(这里推荐用Ubuntu安装,或是CentOS)(Ubuntu的安装比较简单,推荐用VirtualBox,可以去Oracle官网下载VirtualBox(https://www.virtualbox.org/),然后去Ubuntu官网(https://www.ubuntu.com/download)…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

简单介绍在Ubuntu上安装Python的virtualenv

前提:本机安装了Linux系统 (这里推荐用Ubuntu安装,或是CentOS)

(Ubuntu的安装比较简单,推荐用VirtualBox,可以去Oracle官网下载VirtualBox(https://www.virtualbox.org/) ,然后去Ubuntu官网(https://www.ubuntu.com/download) 下载Ubuntu,可以下载桌面版或是服务器版,安装好VirtualBox后,启动VirtualBox,然后选择添加操作系统(可以搜索一下Ubuntu的安装),操作完成后,启动Ubuntu

假设Ubuntu已经安装好了
Ubuntu带有Python 2.7和Python3.x,这里我们选择用Python3
为了快速地下载软件包,可以事先更改一下Ubuntu系统的更新源,默认是US的,我们可以更改为阿里云**

更改Ubuntu更新源:
(Ubuntu的更新源在 /etc/apt/sources.list)
备份一下这个文件 sudo cp /etc/apt/source.list /etc/apt/source.list.bak
用vi或vim打开这个文件 sudo vim /etc/apt/sources.list
*替换文件里的更新地址,可以注释所有地址先 (这里我们用阿里云的更新源,基于Ubuntu17.10,可以查看一下Ubuntu系统的代号 lsb_release -a,这里是artful)
粘贴下面的地址到source.list文件,然后保存退出

deb http://mirrors.aliyun.com/ubuntu/ artful main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ artful-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ artful-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ artful-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ artful-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ artful main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ artful-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ artful-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ artful-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ artful-updates main multiverse restricted universe

然后更新 sudo apt-get update,是刚才的改动生效
上面这个设置改动就可以使用国内的更新源了,如果你是用的Ubuntu桌面,则可以直接在系统设置里更改)

##接下来安装virtualenv

Step 1: login Ubuntu
Step 2: Open terminatewith (Ctrl+Alt+T) (if installed Ubuntu Desktop)
Step 3: Check Python version with command: python3 -V (Python2.7 and Python 3.x have been installed in Ubuntu)
Step 4: Install pip sudo apt-get install python3-pip
Step 5: Check pip version pip3 -V (assumed that pip install successful)
Step 6: Install virtualenv pip3 install virtualenv (check virtualenv version virtualenv --version if install successful)
Step 7: Create a virutal env with command virtualenv venv
Step 8: Activate virtual env with source ./bin/activate (if venv install successful, then created a venv directory, ./bin/activate is based on current directory)

pipenv 可以看官方的文档https://pypi.python.org/pypi/pipenv
这里很详细的介绍了pipenv的应用,这也是official recommend

转载于:https://blog.51cto.com/waytogo/2049549

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/174749.html原文链接:https://javaforall.net

(0)
上一篇 2022年8月26日 上午8:36
下一篇 2022年8月26日 上午8:46


相关推荐

  • wps插入批注快捷键是哪个?

    wps插入批注快捷键是哪个?前言 写论文的时候有时看文章想记录一下当时遇到的疑问 经常会用到注释 WPS 里怎么快速调出这一功能呢 方法 1 方法 2 如果使用键盘以上方法分别为 方法快捷键方法 1ait N L 方法 2alt R C

    2026年3月16日
    2
  • 传感器尺寸

    传感器尺寸传感器尺寸   图像传感器感光区域的面积大小。这个尺寸直接决定了   整个系统的物理放大率。如:1/3”、1/2”等。绝大多数   模拟相机的传感器的长宽比例是4:3(H:V),数字相机   的长宽比例则包括多种:1:1,16:9,3:2etc。   注意相机尺寸的1”=16mm≠25.4mm…

    2022年4月27日
    73
  • pytest的assert_java单元测试断言

    pytest的assert_java单元测试断言前言断言是写自动化测试基本最重要的一步,一个用例没有断言,就失去了自动化测试的意义了。什么是断言呢?简单来讲就是实际结果和期望结果去对比,符合预期那就测试pass,不符合预期那就测试failed

    2022年7月30日
    6
  • springboot框架图解_spring boot框架搭建

    springboot框架图解_spring boot框架搭建本文链接:https://blog.csdn.net/qq_41063141/article/details/83239941

    2022年8月20日
    8
  • 微软面试题大全

    微软面试题大全微软面试题大全 1 为什么下水道的盖子是圆的 nbsp nbsp nbsp nbsp 2 美国有多少辆汽车 nbsp nbsp nbsp nbsp 3 你让工人为你工作七天 回报是一根金条 这个金一平分成相连的 7 段 你必须在每天结束的时候给他们一段金条 如果只许你两次把金条弄断 你如果给你的工人付费 nbsp nbsp nbsp nbsp 3

    2026年3月27日
    2
  • 腾讯元宝 2.37.0.617 正式版

    腾讯元宝 2.37.0.617 正式版

    2026年3月13日
    3

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号