Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inkscape extension doesn't work when Inkscape is installed via Ubuntu Snap #621

Open
Jorgininho opened this issue Sep 21, 2021 · 6 comments
Labels

Comments

@Jorgininho
Copy link

Hello,

I'm working on a fresh install of inkscape and visicut, but the export from inkscape to visicut via extension menu doesn't seems to be working.
Here is the configuration :
OS : Ubuntu 20.04.3 LTS
Inkscape : 1.1
Visicut : 1.9-102

When I try to export a design from inkscape to visicut, i get this :

Traceback (most recent call last):
  File "visicut_export.py", line 267, in <module>
    VISICUTBIN = which("VisiCut.Linux", [VISICUTDIR, "/usr/share/visicut"])
  File "visicut_export.py", line 118, in which
    raise Exception("Cannot find executable {0} in PATH={1}.\n\n"
Exception: Cannot find executable 'VisiCut.Linux' in PATH=['/usr/share/visicut', '/usr/share/visicut', '/snap/inkscape/9090/bin', '/snap/inkscape/9090/usr/sbin', '/snap/inkscape/9090/usr/bin', '/snap/inkscape/9090/sbin', '/snap/inkscape/9090/bin', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', ''].

Please report this bug on https://github.com/t-oster/VisiCut/issues

For a quick fix: Set VISICUTDIR and INKSCAPEDIR in /home/cervin/.config/inkscape/extensions/visicut_export.py

I don't see how to apply the quick fix solution, since the executable are indeed present in the mentioned folders

Thanks

@mgmax
Copy link
Collaborator

mgmax commented Sep 22, 2021

My guess is that you have installed Inkscape as a "snap package". As far as I understand, snap packages are very locked down and can not call outside applications. As far as I understand, you even require special permission to call one snap application from another, and there is no way to launch non-snap applications -- not the best design...

The extension should at least be fixed to include a warning if "/snap/..." is on the PATH and Visicut can not be found.

You can try two workarounds:

  • Start Visicut and then call the extension. If Visicut is already running, it will be contacted via network, maybe this is allowed in snap.
  • Uninstall inkscape and re-install it from the normal "deb" packages (for example, using sudo apt install inkscape in the terminal window). However, you will then probably have an older Inkscape version.

@sebastian-schmid
Copy link
Contributor

For Ubuntu (and Distros based on Ubuntu) I recommend to install inkscape via ppa as described here: https://inkscape.org/release/inkscape-1.1.1/gnulinux/ubuntu/ppa/dl/

sudo add-apt-repository ppa:inkscape.dev/stable
sudo apt update
sudo apt install inkscape

@Jorgininho
Copy link
Author

Hello, thanks for your answer but seems doesn't work for me, What I've done is to clear completely install of Visicut & Inkscape on my computer, to run Inkscape 1.1 as an executable AppImage, then I've installed Visicut 1.9-70 (last available in release of the GIT), all run well on an Ubuntu 20.04.4 LTS
I've tried the same on an Ubuntu 22.04.1 LTS, but got the following error message when I try to use Visicut extension via Inkscape :
/tmp/.mount_InkscaHVklmq/usr/bin/python3.8: can't open file 'visicut_export.py': [Errno 2] No such file or directory

@mgmax
Copy link
Collaborator

mgmax commented Aug 12, 2022

A newer VisiCut version is available via https://download.visicut.org/ .

Please try the basic case of installing Inkscape via the standard way (technically as a DEB package via APT), not anything special like Appimage or snap.

I'm not sure why your Inkscape finds the extension menu entry (.inx file) but not the corresponding .py file. You could have a look at the user and system extension directory, if the files are there, and if the content is readable with some text editing program. These paths are shown in Inkscape: Edit - Preferences - System - (User) extensions.

@Jorgininho
Copy link
Author

So I've installed Inkscape vi command line

sudo add-apt-repository ppa:inkscape.dev/stable
sudo apt update
sudo apt install inkscape

then installed the last package of visicut
sudo apt install ./visicut_1.9-142-gc05b03f5-1_all.deb

Then I've run the install of the extension via Visicut

So when I try to use the extension I got the following error message :
/usr/bin/python3: can't find '__main__' module in '/home/bocal/.'
(bocal is the username)

the 4 extension files are present in the exentension folder

  • daemonize.py
  • visicut_export.inx
  • visicut_export.py
  • visicut_export_replace.inx

I can read all of them with a text editor.
noticing that the option "add in visicut" && "open in visicut" extension in inkscape appears twice

@mgmax
Copy link
Collaborator

mgmax commented Oct 7, 2022

I tried the same and it works, both with Inkscape 1.1 and 1.2:

  • Set up Ubuntu 22.04
  • Option A: Ubuntu 1.1 via apt: In the "Ubuntu software" app, remove the snap version. Then select "ubuntu jammy" as source in the top right corner, then install from there (or you can do the same by 'apt-get install inkscape').
  • Option B: Install Inkscape 1.2 via PPA (as you describe above)
  • Also install visicut as usual
  • Open Inkscape
  • draw something
  • Extensions - lasercut - open in visicut

Please try to clean your user extension directory. Probably you have an old broken version of the extension in it.

With the snap version of Inkscape, visicut doesn't even install the extension into the right directory, so the extension is not found. But the extension does not work anyway. We should add a warning message in Visicut -- check if which inkscape starts with /snap/ and then inform the user that "snap" is currently not supported. (edit: upstream bug: https://gitlab.com/inkscape/inkscape/-/issues/2490 )

@mgmax mgmax changed the title Inkscape extension doesn't connect with visicut Inkscape extension doesn't work with snap Dec 24, 2023
@mgmax mgmax changed the title Inkscape extension doesn't work with snap Inkscape extension doesn't work when Inkscape is installed via Ubuntu Snap Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants