Difference between revisions of "Extension requirements"

From Inkscape Wiki
Jump to navigation Jump to search
(Undo revision 63979 by Reandug (Talk): no relevant uninstall information found on the linked site.)
 
(15 intermediate revisions by 6 users not shown)
Line 1: Line 1:
== Setting Up Effects in Inkscape ==
{{Template:MovedToOtherSite|topic=Extension development|new_url=https://inkscape.gitlab.io/extensions/documentation/|new_site=GitLab}}


For effects to work you need to be using inkscape .42 or later.
----


For info about what effects can do, screenshots, and how to make your own go to [http://www.ekips.org/comp/inkscape/ Aarons Site]
This page is '''outdated'''.


If you are interested in opening special file formats through extensions, see  [[GettingExtensionsWorking]].


=== Unhide the Effects menu ===
For '''alternative information sources''', see also:


This is only necessary in verions .41+CVS to .45.
* The extensions error log in your Inkscape user configuration directory, in case an extension doesn't work. It will list missing dependencies for each extension.


On the "Misc" tab of the "Inkscape Preferences" dialog check the box labeled "Enable script effects". Close and reopen Inkscape
* For info about how to make your own:
** go to [https://inkscape.org/en/develop/extensions/ the corresponding page on our main website]
** also take a look at these Wiki articles: [[Script_extensions | Script Extensions]], [[INX_extension_descriptor_format | INX Extension Descriptor Format]], [[Inkscape-specific_XML_attributes | Inkscape-Specific XML attributes]]
 
* If you are interested in opening special file formats through extensions, see [[GettingExtensionsWorking]].
 
* More info about existing extensions can be found
** [https://inkscape.org/en/download/addons/ in our website's addon gallery]
** and in the [[Extension_repository | Extension Repository page]] of the Wiki.


== Python Effects ==
=== on Debian GNU / Linux ===
    apt-get install python python-xml


=== on Microsoft Windows ===
<b>Important note: From version .44 onwards, Inkscape now includes python in the download, and has effects <i>enabled</i> by default. Therefore these steps are outdated and no longer needed.</b>


# Download [http://www.python.org/download/ Python]
# Install  python and remember the directory you set it to install to. (e.g. C:\Python24 )
# Set your path variable in Windows. For Windows 2000 or XP read [http://support.microsoft.com/default.aspx?scid=kb;en-us;310519&sd=tech Microsofts instructions] or do
## Right Click My Computer
## Properties
## Advanced Tab
## Environment Variables
## In the system variables section select the one named PATH and hit edit.
## Find the end of all the values in there and add ";*path to python*" where *path to python* is the directory you told python to install to (ie c:\program files\python24)
## hit Ok, Ok, Apply
For more general instructions (including instructions for Windows 95,98,ME,NT,2000 and XP) look at the [http://www.chem.gla.ac.uk/%7Elouis/software/faq/q1.html University of Glasgow's] instructions, just remember that you want to set the PATH varable to the python directory. If there is already a path variable, don't delete it, but just add a semicolon and then the full path to the python directory at the end (e.g. PATH = C:\somthing else ; C:\python_directory)
# Reboot
# Download and Install [http://sourceforge.net/project/showfiles.php?group_id=6473 PyXML] for whatever version Python you chose to install


To get the effects menu showing up:
== Python Extensions ==
# Load Inscape
=== on Debian GNU / Linux ===
# Go to File > Inkscape Preferences (Shift+Ctrl+P)
    apt-get install python python-lxml
# Select the "Misc" tab and tick "Enable script effects..."
# Restart Inkscape


If that didn't work, you may like to try to edit the preferences manually:
=== on Microsoft Windows ===
# Go to your preferences.xml file (Documents and Settings/USERNAME/Application Data/Inkscape/preferences.xml)
From version .44 onwards, Inkscape now includes Python in the download, and has extensions <i>enabled</i> by default.
# Search for "id="extensions".  
The latest stable Inkscape version includes Python 2.6.5.
# If you find it: Add the following line above that "show-effects-menu="1".  
# If you can't find it just add
    <group
    show-effects-menu="1"
    id="extensions" />
Save the file, start up inkscape and use those sweet effects


=== on Mac OS X ===
=== on Mac OS X ===


Starting with version 0.46, Inkscape contains the python packages needed for the extension system. All python extensions should work out of the box. However in case you still have trouble you can install them in their regular location.
Starting with version 0.46, Inkscape contains the python packages needed for the extension system. All python extensions should work out of the box. However in case you still have trouble you can install them in their regular location.
==== Binary packages ====
# Download and open http://inkscape.modevia.com/macosx-snap/Python-packages.dmg
# Browse the disk image to find the packages corresponding to your architecture and Python version
#* Your architecture is ppc if you have a G4-G5 based Mac, i386 if you have an Intel Mac
#* By default Panther and Tiger have Python 2.3 and Leopard has Python 2.5. If you have installed a newer version of Python we also provide packages for 2.4
# Copy all the files and folder from the appropriate location to your Python site-packages directory. By default the site-packages directory is /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages  on Panther and Tiger, /Library/Python/2.5/site-packages on Leopard. Otherwise it is somewhere in your custom install of python (/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ for an install of Python 2.4 via MacPorts for example)


==== Compiling from source ====
==== Compiling from source ====
Line 72: Line 45:
The packages are installed in the site-packages directory of your Python install. This is /Library/Python/2.*/site-packages for the stock install of Python on Mac OS X.
The packages are installed in the site-packages directory of your Python install. This is /Library/Python/2.*/site-packages for the stock install of Python on Mac OS X.


== Perl Effects ==
== Perl Extensions ==
=== on Debian GNU / Linux ===
=== on Debian GNU / Linux ===
     apt-get install perl libxml-xql-perl
     apt-get install perl libxml-xql-perl
Line 89: Line 62:
      http://www.cpan.org/authors/id/T/TJ/TJMATHER/XML-XQL-0.68.tar.gz
      http://www.cpan.org/authors/id/T/TJ/TJMATHER/XML-XQL-0.68.tar.gz
         3: open command prompt and locate perl"s lib directory with:
         3: open command prompt and locate perl"s lib directory with:
      perl -e "print qq(@INC)"    (mine was C:[[/Perl/site/lib]])
      perl -e "print qq(@INC)"    (mine was C:/Perl/site/lib)
         4: unpack xml-xql archive
         4: unpack xml-xql archive
         5: copy contents of XML-XQL-*\lib\XML into C:\Perl\site\lib\XML
         5: copy contents of XML-XQL-*\lib\XML into C:\Perl\site\lib\XML
         6: copy XML-XQL-*\XQLParser\Parser.pm to C:\Perl\site\lib\XML\XQL
         6: copy XML-XQL-*\XQLParser\Parser.pm to C:\Perl\site\lib\XML\XQL


== Plugin Effects ==
== Plugin Extensions ==
I have absolutely no idea. Please record your success here. :)
 
Plugins are a special type of extension that are similar to internal extensions. They're written in C/C++ and can directly interface with Inkscape itself. However, they're linked into a separate library that is dynamically loaded at runtime.
 
While this makes them very powerful, they're also significantly harder to code and need to be compiled before being usable. Also the compiled library will be OS/platform-dependent and might not even be compatible between different versions of Inkscape on a single platform.
 
See the [https://gitlab.com/inkscape/inkscape/tree/master/src/extension/plugins/grid2 grid2 extension] for a working prototype of this extension type. If you have an Inkscape development environment set-up
* compile/link with "make grid2"
* copy the linked library (libgrid2.dll/so) and the libgrid2.inx file into the "/extensions" folder.
* run from "Render ->  Grids -> Grid2"


== What if it doesn't work? ==
== What if it doesn't work? ==
Run Inkscape from the console
Use the error messges printed to the console to diagnose the problem (very often missing dependencies)


On Windows you will have to redirect output to a text file like this: "inkscape > output.txt"
* Run Inkscape from the console
* Use the error messages printed to the console to diagnose the problem (very often missing dependencies)
* On Windows you will have to redirect output to a text file like this: "inkscape > output.txt"
* If your operating system (e.g. your Linux distro) uses a different default version of Python (or Perl, Ruby, etc.) than what is required by Inkscape extensions, please see [[Extension_Interpreters#Selecting_a_specific_interpreter_version_.28via_preferences_file.29 | Extension Interpreters]] for how to set the interpreter that Inkscape will use. The most common example of this is that the default Python version of the operating system is 3, but Inkscape requires Python2, resulting in all extensions giving an error.




[[Category:Extensions]]
[[Category:Extensions]]

Latest revision as of 19:54, 3 February 2023

The Inkscape Wiki is no longer used to host information about Extension development.

You can now find related information at GitLab.

This page is kept for historical reasons, e.g. to document specific decisions in Inkscape development.


This page is outdated.


For alternative information sources, see also:

  • The extensions error log in your Inkscape user configuration directory, in case an extension doesn't work. It will list missing dependencies for each extension.



Python Extensions

on Debian GNU / Linux

   apt-get install python python-lxml

on Microsoft Windows

From version .44 onwards, Inkscape now includes Python in the download, and has extensions enabled by default. The latest stable Inkscape version includes Python 2.6.5.

on Mac OS X

Starting with version 0.46, Inkscape contains the python packages needed for the extension system. All python extensions should work out of the box. However in case you still have trouble you can install them in their regular location.

Compiling from source

If you prefer, you can install them from source, it is really easy.

  1. download the source code for sourceforge numpy repository and/or lxml download section
  2. unpack the .tar.gz file
    tar -xzf numpy***.tar.gz lxml***.tar.gz
  3. for each one cd into the newly created directory
  4. build C extensions and install (the install is system wide so you need administrator privileges)
    sudo python setup.py install
    and type your password.

The packages are installed in the site-packages directory of your Python install. This is /Library/Python/2.*/site-packages for the stock install of Python on Mac OS X.

Perl Extensions

on Debian GNU / Linux

   apt-get install perl libxml-xql-perl

on Gentoo GNU / Linux

   emerge -a XML-XQL

on Microsoft Windows

   install ActivePerl
   install XML::XQL::DOM (perhaps like this?)
       1: install prereqs with ppm:
	    install xml-dom
	    install parse-yapp
	    install datemanip
       2: download xml-xql from:
	    http://www.cpan.org/authors/id/T/TJ/TJMATHER/XML-XQL-0.68.tar.gz
       3: open command prompt and locate perl"s lib directory with:
	    perl -e "print qq(@INC)"    (mine was C:/Perl/site/lib)
       4: unpack xml-xql archive
       5: copy contents of XML-XQL-*\lib\XML into C:\Perl\site\lib\XML
       6: copy XML-XQL-*\XQLParser\Parser.pm to C:\Perl\site\lib\XML\XQL

Plugin Extensions

Plugins are a special type of extension that are similar to internal extensions. They're written in C/C++ and can directly interface with Inkscape itself. However, they're linked into a separate library that is dynamically loaded at runtime.

While this makes them very powerful, they're also significantly harder to code and need to be compiled before being usable. Also the compiled library will be OS/platform-dependent and might not even be compatible between different versions of Inkscape on a single platform.

See the grid2 extension for a working prototype of this extension type. If you have an Inkscape development environment set-up

  • compile/link with "make grid2"
  • copy the linked library (libgrid2.dll/so) and the libgrid2.inx file into the "/extensions" folder.
  • run from "Render -> Grids -> Grid2"

What if it doesn't work?

  • Run Inkscape from the console
  • Use the error messages printed to the console to diagnose the problem (very often missing dependencies)
  • On Windows you will have to redirect output to a text file like this: "inkscape > output.txt"
  • If your operating system (e.g. your Linux distro) uses a different default version of Python (or Perl, Ruby, etc.) than what is required by Inkscape extensions, please see Extension Interpreters for how to set the interpreter that Inkscape will use. The most common example of this is that the default Python version of the operating system is 3, but Inkscape requires Python2, resulting in all extensions giving an error.