External libraries and dependencies: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
== Python modules == | == Python modules == | ||
Not all available packages for Python can be part of SweepMe!. Still, you can add these packages to your Device Class and load them from a subfolder. | |||
In that case, it might be that sub-dependencies will be shipped twice, once with SweepMe! and once with your Device Class. | |||
For that reason, we recommnend to use our Library Builder which adds all missing packages to a folder which you can be copied into your Device Class. | |||
The Library Builder is available from your sweep-me.net user account. Please contact us to get one (contact@sweep-me.net). | |||
== DLL | === Requirements === | ||
* Installed environment of Python as used for SweepMe! @FK: we need to state version in credits.html or elsewhere | |||
* All packages installed you need for your Device Class | |||
* @ FK: Is pyinstaller needed? | |||
=== Extracting the missing packages === | |||
# Goto LibraryBuilder folder | |||
# Open build_library.py and change '''sweepme_path''' to your installation path of SweepMe! | |||
# Open required_modules.py and import all packages which are missing in SweepMe! | |||
# Run build_library.py | |||
# Copy the folder libs_required_modules to your DC and rename as desired | |||
# Do not forget to add licence files for each packages you added yourself | |||
=== Loading the mising packages in your Device Class === | |||
# Add the path of your libs within your Device Class to the variable sys.path: | |||
libpath = os.path.dirname(__file__) + "\\libs" | |||
if not libpath in sys.path: | |||
sys.path.append(libpath) | |||
# Now import your libs as usual | |||
import *name of the lib* | |||
# If it does not work, plesae contact us | |||
== DLL == | |||
== .Net DLL == |
Revision as of 23:13, 13 May 2018
Python modules
Not all available packages for Python can be part of SweepMe!. Still, you can add these packages to your Device Class and load them from a subfolder. In that case, it might be that sub-dependencies will be shipped twice, once with SweepMe! and once with your Device Class.
For that reason, we recommnend to use our Library Builder which adds all missing packages to a folder which you can be copied into your Device Class. The Library Builder is available from your sweep-me.net user account. Please contact us to get one (contact@sweep-me.net).
Requirements
- Installed environment of Python as used for SweepMe! @FK: we need to state version in credits.html or elsewhere
- All packages installed you need for your Device Class
- @ FK: Is pyinstaller needed?
Extracting the missing packages
- Goto LibraryBuilder folder
- Open build_library.py and change sweepme_path to your installation path of SweepMe!
- Open required_modules.py and import all packages which are missing in SweepMe!
- Run build_library.py
- Copy the folder libs_required_modules to your DC and rename as desired
- Do not forget to add licence files for each packages you added yourself
Loading the mising packages in your Device Class
- Add the path of your libs within your Device Class to the variable sys.path:
libpath = os.path.dirname(__file__) + "\\libs" if not libpath in sys.path:
sys.path.append(libpath)
- Now import your libs as usual
import *name of the lib*
- If it does not work, plesae contact us