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

How does one import python-pcl in a virtual environment (MacOs)?

Open mnshn opened this issue 6 years ago • 3 comments

I have python-pcl working properly "globally", that is: after successfully installing pcl and python-pcl, I can successfully import pcl in my python project.

However, I'd prefer to work in a virtual environment, using Python's venv. When I Install python-pcl in my virtual enviroment, the module no longer imports poperly, and instead I get an ImportError:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/pauldelange/meg/opm/opm-finder/venv/lib/python3.7/site-packages/pcl/__init__.py", line 2, in <module>
    from ._pcl import *
ImportError: dlopen(/Users/pauldelange/meg/opm/opm-finder/venv/lib/python3.7/site-packages/pcl/_pcl.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets
  Referenced from: /usr/local/opt/pcl/lib/libpcl_outofcore.1.9.dylib
  Reason: Incompatible library version: libpcl_outofcore.1.9.dylib requires version 5.12.0 or later, but QtWidgets provides version 5.7.0

Your Environment

  • Operating System and version: MacOS Catalina (10.15) Python 3.7.4
  • Compiler:
  • PCL Version: PCL 1.9.1 Green Python-pcl 0.3.0a1
  • Cython Version: 0.29.14

Context

I am trying to run python-pcl in a (python) virtual environment (using venv) after activating the venv, and installing python pcl with pip

Expected Behavior

Given that globally -- not using venv -- the python-pcl package is properly imported, I would expect a successful import in my virtual environment also

Current Behavior

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/pauldelange/meg/opm/opm-finder/venv/lib/python3.7/site-packages/pcl/__init__.py", line 2, in <module>
    from ._pcl import *
ImportError: dlopen(/Users/pauldelange/meg/opm/opm-finder/venv/lib/python3.7/site-packages/pcl/_pcl.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets
  Referenced from: /usr/local/opt/pcl/lib/libpcl_outofcore.1.9.dylib
  Reason: Incompatible library version: libpcl_outofcore.1.9.dylib requires version 5.12.0 or later, but QtWidgets provides version 5.7.0

Code to Reproduce

1. python -m venv venv
2. source venv/bin/activate
3. pip install python-pcl
4. python -c 'import pcl'

Possible Solution

mnshn avatar Nov 26 '19 13:11 mnshn

Having the same issue with conda, in my case libpcl_outofcore.1.9.dylib is nowhere to be found. Tx in advance!

davethejoy avatar Apr 08 '20 10:04 davethejoy

Having the same issue in Ubuntu 18.04.5 LTS. Has anyone found a solution yet?

xleEmesent avatar Sep 02 '20 00:09 xleEmesent

https://github.com/strawlab/python-pcl/issues/374#issuecomment-1318440769 Hope helps.

where2go947 avatar Nov 17 '22 10:11 where2go947