python-pcl
python-pcl copied to clipboard
Python 3.8 compatibility issue
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!
Maybe you can try
sudo apt install python3-pcl
It just supports python3.8 env.
I've tried, however I'm using conda environment, which, I think, isn't supported. I might try python3.8 venv.
I had tried python3.8 venv. I think still not support now
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.
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'
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-pclThen, I test bypython -c 'import pcl'ShowModuleNotFoundError: No module named 'pcl'Also, I then triedpip install python-pclbut 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.
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.
Do we have any update regarding support in conda env?
We are seeking a maintainer. Please see https://github.com/strawlab/python-pcl/issues/395.
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.
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 ?
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+"
Manually copy pcl to site-packages does not work with 3.7:
.....${ENV_PATH}....../lib/python3.7/site-packages/pcl/init.py in
ModuleNotFoundError: No module named 'pcl._pcl'
My Environment
Ubuntu 20.04 python version: 3.8
Solutions
- Install
python-pclfrom ubuntu source
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
pclshould work
python -c 'import pcl'
- To work on virtual environment like
venvoranaconda, copy the pcl directories to the target dir. - First, check directories,
pclandpython_pcl-0.3.egg-infoare supposed to be existed.
cd /usr/lib/python3/dist-packages
ls -l | grep pcl
- Then, copy them to
~/tmpand changeowner,groupand permission. Note replaceuser-namewith 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-nameor~/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.
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'