遇到一个问题折腾很久,记录一下.
环境:ubuntu20.0 python3.8
起因是想运行这个开源代码
https://github.com/Derek-TH-Wang/quadruped_ctrl
但发现找不的pcl.
然后用conda想按照pcl,常用命令,无非就是conda install -c xx python-pcl.
后来在anaconda-navigator中也看到已经安装有pcl了
但就是import pcl 说找不到
后来用各种命令尝试:
conda install -c sirokujira python-pcl --channel conda-forge
也都不行.
不知为何时,突然注意到提示信息:
$ conda install -c sirokujira python-pcl --channel conda-forge
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- python-pcl -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0']
Your python: python=3.8
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
The following specifications were found to be incompatible with your system:
- feature:/linux-64::__glibc==2.31=0
- feature:|@/linux-64::__glibc==2.31=0
Your installed version is: 2.31
好吧,conda还是很厉害的,直接告诉你了原因: python版本不兼容啊.人家要求pcl的版本是
version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0'
但半小时前,也是过conda新建enviroment,然后用了这个教程:
https://blog.csdn.net/qq_40700822/article/details/116403749?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-0.control&spm=1001.2101.3001.4242
用了新环境,python3.6版本,走到最后,还是遇到了一个新问题:
ImportError: /home/allen/anaconda3/envs/name_pcl/lib/python3.6/site-packages/pcl/../../.././libpcl_io_ply.so.1.8: undefined symbol: _ZN5boost6system15system_categoryEv
还是没成功啊.
参考知呼帖子:
https://zhuanlan.zhihu.com/p/162277657
还没试过用源码安装.
是了用pip3 install python-pcl, 也是报错:
$ pip3 install python-pcl
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/python-pcl/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/python-pcl/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/python-pcl/
Collecting python-pcl
Using cached python-pcl-0.3.0a1.tar.gz (14 kB)
ERROR: Command errored out with exit status 1:
command: /home/allen/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-s69xq4u7/python-pcl_065ac155790947aa9d93d8a5b2675058/setup.py'"'"'; __file__='"'"'/tmp/pip-install-s69xq4u7/python-pcl_065ac155790947aa9d93d8a5b2675058/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-z9j9bzrt
cwd: /tmp/pip-install-s69xq4u7/python-pcl_065ac155790947aa9d93d8a5b2675058/
Complete output (6 lines):
/tmp/pip-install-s69xq4u7/python-pcl_065ac155790947aa9d93d8a5b2675058/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
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/8c/78/372264333493d53cf2cfc7427df3eb752a6cdf5b9f8ee7b53bc30780401d/python-pcl-0.3.0a1.tar.gz#sha256=9fde004530143396c56c71d089a6c7391b3afadd1c569d38f1504966e2d203c3 (from https://pypi.org/simple/python-pcl/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached python-pcl-0.3.0.dev1.tar.gz (14 kB)
ERROR: Command errored out with exit status 1:
command: /home/allen/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-s69xq4u7/python-pcl_354f28aed2314772a8b75ec980602b4d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-s69xq4u7/python-pcl_354f28aed2314772a8b75ec980602b4d/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-gxsj99hl
cwd: /tmp/pip-install-s69xq4u7/python-pcl_354f28aed2314772a8b75ec980602b4d/
Complete output (6 lines):
/tmp/pip-install-s69xq4u7/python-pcl_354f28aed2314772a8b75ec980602b4d/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
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/62/e5/5478d25e8dbe34cf5080a2992cc8fba028eb1a2f5e19b926369b7344be15/python-pcl-0.3.0.dev1.tar.gz#sha256=eadee7de650f6193182308fb431f82029741e3a3e16bd1a2f7e00b3edcf9e7d7 (from https://pypi.org/simple/python-pcl/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement python-pcl
ERROR: No matching distribution found for python-pcl
看到帖子的小伙伴,如果成功了, 烦请分享一下啊.