Python3.8 安装调用pcl库_2023.1

在conda环境调用pcl库

直接按照命令安装后,在conda环境中调用,直接复制库过去就好。搞了很久,参考github回答搞定。复制到这里,以供参考。

My Environment

Ubuntu 20.04
python version: 3.8

Solutions

sudo apt-get update
sudo apt-get install python3-pcl pcl-tools
  • Now that in the default "global" base environment, open a new shell, the pcl should work
python -c 'import pcl'
  • To work on virtual environment like venv or anaconda, copy the pcl directories to the target dir.
  • First, check directories, pcl and python_pcl-0.3.egg-info are supposed to be existed.
cd /usr/lib/python3/dist-packages
ls -l | grep pcl
  • Then, copy them to ~/tmp and change ownergroup and permission. Note replace user-name with your user name.
sudo cp -r pcl ~/tmp
sudo cp -r python_pcl-0.3.egg-info/ ~/tmp
cd ~/tmp && ls -l
sudo chown -R user-name pcl python_pcl-0.3.egg-info
sudo chgrp -R user-name pcl python_pcl-0.3.egg-info
sudo chmod -R 775 pcl python_pcl-0.3.egg-info
ls -l
  • Finally, move them to your target dir. Note replace ~/.virtualenvs/env-name or ~/anaconda/envs/py38with your virtualenv environment path.
# for venv
cp -r pcl python_pcl-0.3.egg-info ~/.virtualenvs/env-name/lib/python3.8/site-packages
# or for anaconda
cp -r pcl python_pcl-0.3.egg-info ~/anaconda/envs/py38/lib/python3.8/site-packages

# After copy do not forget to remove dirs in `~/tmp`.
rm -rf pcl python_pcl-0.3.egg-info
  • Now activate the virtual environment. Check:
python -c 'import pcl'

Hope helps.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值