python-pcl icon indicating copy to clipboard operation
python-pcl copied to clipboard

Python 3.8 compatibility issue

Open DarkGeekMS opened this issue 5 years ago • 15 comments

My Environment

  • Operating System and version: Ubuntu 20.04
  • Python version: 3.8

Context

I'm unable to install python-pcl in a python3.8 environment. I always got this error :

ERROR: Command errored out with exit status 1:
     command: /home/<name>/anaconda3/envs/pytorch_dev/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9nm8v2ed/python-pcl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9nm8v2ed/python-pcl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-p197x2th
         cwd: /tmp/pip-install-9nm8v2ed/python-pcl/
    Complete output (6 lines):
    /tmp/pip-install-9nm8v2ed/python-pcl/setup.py: error: cannot find PCL, tried
        pkg-config pcl_common-1.9
        pkg-config pcl_common-1.8
        pkg-config pcl_common-1.7
        pkg-config pcl_common-1.6
        pkg-config pcl_common
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

However, the installation works fine in a python3.6 environment. I tried installation with pip and from source, but the error persists.

I was wondering if there is any workaround for installing python-pcl in a python3.8 environment ? And is there any plan for adding python3.8 support ?

Thanks!

DarkGeekMS avatar Aug 30 '20 00:08 DarkGeekMS

Maybe you can try sudo apt install python3-pcl It just supports python3.8 env.

guodashun avatar Sep 08 '20 03:09 guodashun

I've tried, however I'm using conda environment, which, I think, isn't supported. I might try python3.8 venv.

DarkGeekMS avatar Sep 08 '20 11:09 DarkGeekMS

I had tried python3.8 venv. I think still not support now

moonstarsky37 avatar Sep 16 '20 04:09 moonstarsky37

I had tried python3.8 venv. I think still not support now

For me the ubuntu version is 20.04, so there is an available package in apt-list.

guodashun avatar Sep 16 '20 04:09 guodashun

For me the ubuntu version is 20.04, so there is an available package in apt-list.

Yep, I know that is an available package in apt-list. But after install by sudo apt install python3-pcl Then, I test by python -c 'import pcl' Show ModuleNotFoundError: No module named 'pcl' Also, I then tried pip install python-pcl but still have some error.

I using following on Ubuntu 20.04. If I do something wrong, let me know, thx.

sudo apt-get install python3.8 python3.8-dev python3.8-distutils python3.8-venv
python3.8 -m venv dev3.8/
source dev3.8/bin/activate
sudo apt install python3-pcl
python -c 'import pcl'

moonstarsky37 avatar Sep 16 '20 07:09 moonstarsky37

For me the ubuntu version is 20.04, so there is an available package in apt-list.

Yep, I know that is an available package in apt-list. But after install by sudo apt install python3-pcl Then, I test by python -c 'import pcl' Show ModuleNotFoundError: No module named 'pcl' Also, I then tried pip install python-pcl but still have some error.

I using following on Ubuntu 20.04. If I do something wrong, let me know, thx.

sudo apt-get install python3.8 python3.8-dev python3.8-distutils python3.8-venv
python3.8 -m venv dev3.8/
source dev3.8/bin/activate
sudo apt install python3-pcl
python -c 'import pcl'

Maybe you can check your site-packages folder to make sure that the package pcl is in the right env.

guodashun avatar Sep 16 '20 08:09 guodashun

As @guodashun said, For Ubuntu 20.04, it worked for me as well on python3 venv, however it's still not compatible with conda envs.

DarkGeekMS avatar Sep 16 '20 14:09 DarkGeekMS

Do we have any update regarding support in conda env?

sanosay avatar Oct 14 '21 09:10 sanosay

We are seeking a maintainer. Please see https://github.com/strawlab/python-pcl/issues/395.

astraw avatar Oct 17 '21 07:10 astraw

Do we have any update regarding support in conda env?

You can manually copy it to your conda env after apt install. It works fine for me with python3.6.

BeBeBerr avatar Dec 19 '21 18:12 BeBeBerr

I had tried python3.8 venv. I think still not support now

For me the ubuntu version is 20.04, so there is an available package in apt-list.

can you specify it ?

Petros626 avatar May 11 '22 04:05 Petros626

from https://python-pcl-fork.readthedocs.io/en/rc_patches4/install.html. In the "installation guide" part, it is said "python-pcl is supported on Python 2.7.6+, 3.4.0, 3.5.0+, 3.6.0+"

linhushaoxia-le avatar Jun 16 '22 10:06 linhushaoxia-le

Manually copy pcl to site-packages does not work with 3.7:

.....${ENV_PATH}....../lib/python3.7/site-packages/pcl/init.py in 1 # XXX do a more specific import! ----> 2 from ._pcl import * 3 # vtkSmartPointer.h error (Linux) 4 # from .pcl_visualization import * 5 # from .pcl_grabber import *

ModuleNotFoundError: No module named 'pcl._pcl'

xiaoliangbai avatar Jul 12 '22 22:07 xiaoliangbai

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 owner, group 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.

where2go947 avatar Nov 17 '22 10:11 where2go947

Hi @where2go947 , I got this error after following your solutions. Any idea what went wrong? I'm on Ubuntu22.04 with python 3.8

ModuleNotFoundError: No module named 'pcl._pcl'

wzhou-abyss avatar Feb 13 '23 11:02 wzhou-abyss