inkex.py not found for extensions in user's directory
Thanks to ~suv I now have a copy of the inksyntax plug-in
I am having trouble installing it but I think it's outside of inksyntax.
At the interactive terminal I tried to import all the dependencies that inksyntax has.
I could not import: inkex.py
and
simplestyle.py
It looks like this may be a bug:
https://bugs.launchpad.net/inkscape/+bug/551433
I am on xubuntu 11.10
I have installed a few plug-ins through synaptic
Does anyone know how to export variables so that python will be able to find these two .py files or some other solution?
Thanks
On 12/08/2012 18:15, Patrick wrote:
Thanks to ~suv I now have a copy of the inksyntax plug-in
I am having trouble installing it but I think it's outside of inksyntax.
1) Copy both files (inksyntax.inx, inksyntax.py) into
~/.config/inkscape/extensions
2) make the python script executable:
chmod 755 ~/.config/inkscape/extensions/inksyntax.py
2) restart Inkscape
3) the extension is available in menu
'Extensions > Text > InkSyntax'
4) Calling the extension will open an external dialog (using pygtk or tk) which allows to paste text (or source code), and choose the corresponding syntax (provided by pygments or highlight).
At the interactive terminal I tried to import all the dependencies that inksyntax has.
I could not import: inkex.py
and
simplestyle.py
The extension script is usually run from within Inkscape which takes care to add the required paths to the python environment ('inkex.py' and 'simplestyle.py' are python modules distributed/installed with Inkscape itself).
If - for whatever reason - you want to run the script externally (without Inkscape) from the command line, you might want to either a) adjust the path to Inkscape's shared extensions directory in 'inksyntax.py' (line 19), or b) install the extension (both files) into the shared extensions directory (AFAIU line 21 in inksyntax.py would take of adding that directory to $PYTHONPATH). This requires admin privileges, usually.
To know where your installed version of Inkscape loads the shared extensions from, use this command line option:
$ inkscape -x
It looks like this may be a bug:
Unlikely - that report is specific to Inkscape packaged as Mac OS X application, and did not occur with regular installs on Linux distros (or Mac OS X). It also had been fixed in time before the initial release of 0.48 (IIRC it only occurred in development builds, never on any stable release).
I am on xubuntu 11.10
I have installed a few plug-ins through synaptic
Does anyone know how to export variables so that python will be able to find these two .py files or some other solution?
I'm not sure I really understand your problem: the extension should work out-of-the-box if run from within Inkscape, even on xubuntu - if you have the other dependencies installed (pygments (optional/also works with: highlight) and PyGtk (optional/also works with: TkInter)).
hth, ~suv
Thanks ~suv !
It works perfectly now.
It's so easy once you know what to do.....
Thanks for you help to Mike. I am just going to stick with inksyntax for now but I bet that will work as a back up. Thanks for taking the time to answer my post.
Have a great day guys-Patrick
participants (2)
-
Patrick
-
~suv