Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Python 3.8 compatibility issue #374

Open
DarkGeekMS opened this issue Aug 30, 2020 · 15 comments
Open

Python 3.8 compatibility issue #374

DarkGeekMS opened this issue Aug 30, 2020 · 15 comments

Comments

@DarkGeekMS
Copy link

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!

@guodashun
Copy link

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

@DarkGeekMS
Copy link
Author

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

@moonstarsky37
Copy link

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

@guodashun
Copy link

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.

@moonstarsky37
Copy link

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'

@guodashun
Copy link

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.

@DarkGeekMS
Copy link
Author

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.

@sanosay
Copy link

sanosay commented Oct 14, 2021

Do we have any update regarding support in conda env?

@astraw
Copy link
Member

astraw commented Oct 17, 2021

We are seeking a maintainer. Please see #395.

@BeBeBerr
Copy link

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.

@Petros626
Copy link

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 ?

@linhushaoxia-le
Copy link

linhushaoxia-le commented Jun 16, 2022

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+"

@xiaoliangbai
Copy link

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'

@where2go947
Copy link

where2go947 commented Nov 17, 2022

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.

@wzhou-abyss
Copy link

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'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests