Ubuntu 配置conda环境过程中的一些坑

Ubuntu安装环境

第一步:把apt-get换成国内源:https://blog.csdn.net/qq_35759574/article/details/82842637

第二步:sudo apt install python 虚拟机自动安装的Ubuntu 没有默认python

第三步: sudo apt install python-pip 在有python的情况下安装pip

 

第四步:把从清华镜像网站下载的Anaconda文件安装 1、cd Downloads/  2、bash Anaconda3-2019.10-Linux-x86_64.sh

第五步:配置conda 环境变量

sudo gedit ~/.bashrc

export PATH="/home/ck/anaconda3/bin:$PATH"

 

第六步:配置pip清华镜像 如果ubuntu没有安装 vim 就用:sudo apt-get install vim 安装(用pip安装出错)

mkdir ~/.pip

vim ~/.pip/pip.conf

写入:

[global]

index-url = https://pypi.mirrors.ustc.edu.cn/simple/

trusted-host = mirrors.aliyun.com

# 一定要注意,http后面是要加s的,不然会WARNING然后报错报错报错!这个亏吃一次不要再吃第二次!

 

第七步:

如果输入 conda activate 环境名 后出现   CommandNotFoundError: Your shell has not been properly configured to use 'conda activate’.

# 激活环境

source activate

# 退出环境

source deactivate

 

第八步:conda install pygame 是不成功的  所以使用 pip install pygame

pip install pygame安装报错采取

措施:install dependencies

sudo apt-get install mercurial python3-dev python3-numpy ffmpeg \

    libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev \

    libsdl1.2-dev  libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev

后 继续 使用: pip install pygame 原文链接:https://blog.csdn.net/u010093134/article/details/79847904

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值