plottertools / hatched

Convert images to plotter-friendly hatched patterns
MIT License
95 stars 9 forks source link

Install breaks Qt #16

Closed sr67 closed 2 years ago

sr67 commented 2 years ago

After installing with pipx inject I get qt error when I try to use vpype show e.g. "vpype random show" works fine, but after injecting hatched I get the error below. Thoughts?

$ vpype --version vpype 1.11.0a0

$ pipx inject vpype hatched injected package hatched into venv vpype done!

$ vpype random show QObject::moveToThread: Current thread (0x564880d67810) is not the object's thread (0x564880d74d20). Cannot move to target thread (0x564880d67810)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/art/.local/pipx/venvs/vpype/lib/python3.9/site-packages/cv2/qt/plugins" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.

Aborted

abey79 commented 2 years ago

I can't reproduce this. Can you provide more information on your OS, how you installed Python and pipx, etc.

Also, how did you install vpype in the first place? The current version is 1.10. Did you install vsketch as well?

sr67 commented 2 years ago

Hi, sure. Thanks for having a look

OS: lsb_release -a No LSB modules are available. Distributor ID: Kali Description: Kali GNU/Linux Rolling Release: 2021.1 Codename: kali-rolling

Python: Don't recall how, or if, I installed, but... python --version Python 3.9.5

vpype: pipx install "vpype[all]" pipx inject vpype git+https://github.com/abey79/vsketch --include-apps pipx inject vpype hatched

I also injected the following, but only get this behavior when I inject hatched in any order in the process pipx inject vpype vpype-occult pipx inject vpype vpype-perspective pipx inject vpype vpype-embroidery pipx inject vpype vpype-vectrace pipx inject vpype git+https://github.com/serycjon/vpype-flow-imager pipx inject vpype vpype-pixelart

abey79 commented 2 years ago

Can you provide the output of pipx inject --verbose vpype hatched (when starting clean)?

Edit: actually the whole thing would be interesting:

$ pipx uninstall vpype
$ pipx install --verbose vpype
$ pipx inject --verbose vpype hatched
sr67 commented 2 years ago

$ pipx uninstall vpype
uninstalled vpype! ✨ 🌟 ✨

$ pipx install --verbose vpype
pipx >(setup:729): pipx version is 1.0.0 pipx >(setup:730): Default python interpreter is '/home/art/miniconda3/bin/python' pipx >(package_name_from_spec:323): Determined package name: vpype pipx >(package_name_from_spec:324): Package name determined in 0.0s creating virtual environment... pipx >(run_subprocess:172): running /home/art/miniconda3/bin/python -m venv --without-pip /home/art/.local/pipx/venvs/vpype pipx >(run_subprocess:172): running /home/art/.local/pipx/venvs/vpype/bin/python -c import sysconfig; print(sysconfig.get_path('purelib')) pipx >(run_subprocess:172): running /home/art/.local/pipx/shared/bin/python -c import sysconfig; print(sysconfig.get_path('purelib')) pipx >(run_subprocess:172): running /home/art/.local/pipx/venvs/vpype/bin/python --version pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: vpype installing vpype... pipx >(run_subprocess:172): running /home/art/.local/pipx/venvs/vpype/bin/python -m pip install vpype pipx >(run_subprocess:172): running pipx >(get_venv_metadata_for_package:303): get_venv_metadata_for_package: 136ms pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: vpype pipx >(needs_upgrade:69): Time since last upgrade of shared libs, in seconds: 246123. Upgrade will be run by pipx if greater than 2592000. installed package vpype 1.10.0, installed using Python 3.9.5 These apps are now globally available

$ vpype random show WARNING:root:!!! show: vpype viewer not available, reverting to classic mode. Note: use pip install vpype[all] to install the vpype viewer. WARNING:root:!!! show: classic viewer not available, ignore command. Note: use pip install matplotlib to enable the classic viewer.

$ pipx inject --verbose vpype hatched pipx >(setup:729): pipx version is 1.0.0 pipx >(setup:730): Default python interpreter is '/home/art/miniconda3/bin/python' pipx >(run_pipx_command:169): Virtual Environment location is /home/art/.local/pipx/venvs/vpype pipx >(needs_upgrade:69): Time since last upgrade of shared libs, in seconds: 246223. Upgrade will be run by pipx if greater than 2592000. pipx >(package_name_from_spec:323): Determined package name: hatched pipx >(package_name_from_spec:324): Package name determined in 0.0s pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: hatched installing hatched... pipx >(run_subprocess:172): running /home/art/.local/pipx/venvs/vpype/bin/python -m pip install hatched pipx >(run_subprocess:172): running pipx >(get_venv_metadata_for_package:303): get_venv_metadata_for_package: 469ms pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: hatched injected package hatched into venv vpype done! ✨ 🌟 ✨

$ vpype random show WARNING:root:!!! show: vpype viewer not available, reverting to classic mode. Note: use pip install vpype[all] to install the vpype viewer.

sr67 commented 2 years ago

Same error if I install just vpype[all] and hatched without vsketch. And vpype version remains 1.10.0 without vsketch install. show works before hatched install but not after.

$ pipx install --verbose "vpype[all]" pipx >(setup:729): pipx version is 1.0.0 pipx >(setup:730): Default python interpreter is '/home/art/miniconda3/bin/python' pipx >(package_name_from_spec:323): Determined package name: vpype pipx >(package_name_from_spec:324): Package name determined in 0.0s creating virtual environment... pipx >(run_subprocess:172): running /home/art/miniconda3/bin/python -m venv --without-pip /home/art/.local/pipx/venvs/vpype pipx >(run_subprocess:172): running /home/art/.local/pipx/venvs/vpype/bin/python -c import sysconfig; print(sysconfig.get_path('purelib')) pipx >(run_subprocess:172): running /home/art/.local/pipx/shared/bin/python -c import sysconfig; print(sysconfig.get_path('purelib')) pipx >(run_subprocess:172): running /home/art/.local/pipx/venvs/vpype/bin/python --version pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: vpype[all] installing vpype from spec 'vpype[all]'... pipx >(run_subprocess:172): running /home/art/.local/pipx/venvs/vpype/bin/python -m pip install vpype[all] pipx >(run_subprocess:172): running pipx >(get_venv_metadata_for_package:303): get_venv_metadata_for_package: 381ms pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: vpype[all] pipx >(needs_upgrade:69): Time since last upgrade of shared libs, in seconds: 247428. Upgrade will be run by pipx if greater than 2592000. installed package vpype 1.10.0, installed using Python 3.9.5 These apps are now globally available

(this works) $ vpype random show
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-art'

$ pipx inject --verbose vpype hatched pipx >(setup:729): pipx version is 1.0.0 pipx >(setup:730): Default python interpreter is '/home/art/miniconda3/bin/python' pipx >(run_pipx_command:169): Virtual Environment location is /home/art/.local/pipx/venvs/vpype pipx >(needs_upgrade:69): Time since last upgrade of shared libs, in seconds: 247442. Upgrade will be run by pipx if greater than 2592000. pipx >(package_name_from_spec:323): Determined package name: hatched pipx >(package_name_from_spec:324): Package name determined in 0.0s pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: hatched installing hatched... pipx >(run_subprocess:172): running /home/art/.local/pipx/venvs/vpype/bin/python -m pip install hatched pipx >(run_subprocess:172): running pipx >(get_venv_metadata_for_package:303): get_venv_metadata_for_package: 442ms pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: hatched injected package hatched into venv vpype done! ✨ 🌟 ✨

$ vpype --version vpype 1.10.0

$ vpype random show QObject::moveToThread: Current thread (0x563e8563f400) is not the object's thread (0x563e8564c980). Cannot move to target thread (0x563e8563f400)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/art/.local/pipx/venvs/vpype/lib/python3.9/site-packages/cv2/qt/plugins" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.

Aborted

abey79 commented 2 years ago

OK, I think I've figured it out (and could have from your first message -- sorry for having you run circles 😅).

Try:

$ pipx runpip vpype uninstall opencv-python
$ pipx runpip vpype install opencv-python-headless

The base OpenCV installation includes a Qt distribution that appears to interfere with PySide2 in your case.

sr67 commented 2 years ago

No worries, appreciate your help! Yes that seems to have solved my issue. Thanks so much.

abey79 commented 2 years ago

Juste released hatched 0.2.0, which fixes this issue for good.