i'm using inkscape as long as i can remember, and it's is one of my favorite softwares ever. i'm doing art, planing, landscapedesigning, board game designing and a lot more. thanks a lot!
i'm also a moderate expirienced coder, spend some time with python, but this is my first try with inkscape extensions. yay.
so what i don't really understand is how to integreate python libreries that i want to use within my extension script, that does not regulary includes in inkscape, to be specific, i want to import https://pysolar.org/ so i can use it to calculate shadows of buldings on an imported map or arial photo.
would be very helpful to have some instructions on how to include it.
There's two different problems, one is "can I use external libraries when I run it myself" which is "mostly; yes" and the second is "Can I easily make an extension which other people would be able to install without too many problems" the second question is the more difficult one.
We've put together an extensions manager which can install python packages, if you package up an extension using a setup.py file which labels pysolar as a dependency, then it will install the required library at the right time. This is very new and will be available in Inkscape 1.1 or later. The problem is wheels. Python libraries can come in three flavours, python-only-sources, which are the default and are easy. python-plus-c sources, which are hard because they require a compiler on the computer and python wheels, which are pre-compiled binaries. So long as the library is either python-only or has wheels, it should be installable for multiple operating systems.
1. If a tutorial about packaging extension will be available, to simplifing the right way to do it.
2. when 1.1 is supposed to come out?
3. a question: so for now i can install the library simply to pyhon 3 on my enviorment and when i import it inside the extension, it will operate inside inkscape? sorry for the novice question. i'm just trying to be clear about it.
So, can anyone point me in the direction of a plugin that uses python libreries that was installed manually? cause i don't really know how to control wich python version and environment inkscape is using withing the specific machine
I'm afraid there is no "easy" solution for this at this time but you have some options:
The extension manager Martin mentioned hopefully solves this in the future but still is in its very early stages, so at this time it definitely could use testers and developers. It's really ready for production yet, but if you want to get involved to make it ready sooner that would certainly be great!
If you're confident people have some technical expertise just tell them about the dependencies in your documentation and ask them to install them if they want to use your extension.
Many extensions go the way of providing manual installers or at least a compressed archive including all dependencies. As pysolar does not seem to include binary components this could work in your case as well. Just include a local copy of the module in a place where python will find it (i.e. either in a subfolder of your extension or in the top-level "extensions" directory).
hi everybody.
i'm using inkscape as long as i can remember, and it's is one of my favorite softwares ever. i'm doing art, planing, landscapedesigning, board game designing and a lot more. thanks a lot!
i'm also a moderate expirienced coder, spend some time with python, but this is my first try with inkscape extensions. yay.
so what i don't really understand is how to integreate python libreries that i want to use within my extension script, that does not regulary includes in inkscape, to be specific, i want to import https://pysolar.org/ so i can use it to calculate shadows of buldings on an imported map or arial photo.
would be very helpful to have some instructions on how to include it.
cheers.
I Asafche,
I'm the extensions lead for Inkscape.
There's two different problems, one is "can I use external libraries when I run it myself" which is "mostly; yes" and the second is "Can I easily make an extension which other people would be able to install without too many problems" the second question is the more difficult one.
We've put together an extensions manager which can install python packages, if you package up an extension using a setup.py file which labels pysolar as a dependency, then it will install the required library at the right time. This is very new and will be available in Inkscape 1.1 or later. The problem is wheels. Python libraries can come in three flavours, python-only-sources, which are the default and are easy. python-plus-c sources, which are hard because they require a compiler on the computer and python wheels, which are pre-compiled binaries. So long as the library is either python-only or has wheels, it should be installable for multiple operating systems.
Hi.
thanks for the fast reply. so i'm wandering:
1. If a tutorial about packaging extension will be available, to simplifing the right way to do it.
2. when 1.1 is supposed to come out?
3. a question: so for now i can install the library simply to pyhon 3 on my enviorment and when i import it inside the extension, it will operate inside inkscape? sorry for the novice question. i'm just trying to be clear about it.
cheers.
The best thing is to have a good example that i can learn from it how to, for now, "use external libraries when I run it myself".
So, can anyone point me in the direction of a plugin that uses python libreries that was installed manually? cause i don't really know how to control wich python version and environment inkscape is using withing the specific machine
@doctormo
I'm afraid there is no "easy" solution for this at this time but you have some options: