Ubuntu的换源问题&python-pcl库安装

前言

我是什么时候意识到,我安装完Ubuntu之后没有换源这个问题很严重的呢…

大概是我要安装python-pcl库,却死活下不动的时候吧…

sudo apt install python3-pcl

大概就是这样的疯狂error:
在这里插入图片描述

尝试过:

sudo vi /etc/resolv.conf
sudo apt-get update

往其中添加:

nameserver 8.8.8.8
nameserver 223.5.5.5
nameserver 223.6.6.6

但是并没能解决啊…

换源才是王道

参考链接:安装Ubuntu后需要做的事

阿里云镜像站 -> Ubuntu 镜像

sudo vim /etc/apt/sources.list
# 把里面整个内容替换成阿里源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

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

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

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

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
sudo apt-get update
# 更新完之后再执行 
sudo apt install python3-pcl
# 至此 成功把python-pcl安装在本地base环境中
如果想挪到Anaconda的某个虚拟环境中,执行以下操作:

找到系统python库安装目录/usr/lib/python3/dist-packages,把python-pcl ( python_pcl-0.3.egg-infopcl )移动到Anaconda的虚拟环境的 ~/anaconda3/envs/py38/lib/python3.8/site-packages 目录下即可。

注意: Ubuntu 20.4 系统版本 Python 3.8.2 因此,另起一个虚拟环境 py38 也需要是 python 3.8

参考链接:Ubuntu20安装python-pcl

在这里插入图片描述
在这里插入图片描述
至此在 py38 就已经安装好了 python-pcl

测试:

# 进入 py38 环境中
python
>>>import pcl

但是,仍然存在一些奇怪的问题…

在之前装机记录的Blog里我们能看到的是系统版本是3.8,但是在 Anaconda 的 base 环境下运行 python 命令显示的版本确是 3.9.7 并且安装在本地的 python pcl 不能被正确调用?

(我寻思着…大概是版本冲突问题?——具体原因暂时没找到…)
在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值