2.12 Tips
20220814
Software Dependencies
Most packages depend on other software and that software will need to be installed for the package to be usable. This installation of other software can take some time. If you update the model the software might need to be installed again. And some software is used across multiple packages, and so will need to be installed for each of the packages.
To reduce the amount of re-installing of software we can often install it into our own account or ask a system administrator to install.
For most MLHub packages it is often useful to install dependent
software through the operating system (with system administrator
privileges), especially those that are identified as system
dependencies in MLHUB.yaml
. If you have system administrator
privilege (generally through the sudo command) then
you may want to checkout a package’s MLHUB.yaml
file to install
those dependencies on the system, rather than per user when they
install the MLHub package. For example, if cargo
is a system
dependency, then with system administrator privileges:
wajig install cargo
R dependencies are automatically installed by mlhub locally for the user if they have not already been installed by the user or available on the system. Such installations do not interfere with other installations of the same software.
Some software dependencies are required for multiple MLHub packages
and so can be pre-installed. Any software package listed in the cran
section of the MLHUB.yaml
file can be installed just once by the
user. For example, if rpart
and tidyverse
are required the user
can run the following command:
Rscript -e 'install.packages(c("rpart", "tidyverse"))'
If you have system administration privileges, then you can install the Ubuntu versions of this software:
wajig install r-cran-rpart r-cran-tidyverse
Similarly for common Python dependencies. One particular example is tensorflow which does not have a Ubuntu package and thus is installed using pip. This can be installed any time by a user, and any mlhub package that requires tensorflow will not need to install it separately (unless they require a specific version of tensorflow).
pip install tensorflow
Package Stops Working
If a model has installed badly, got corrupted, or not working as expected, sometimes an uninstall followed by install will fix the problem. When uninstalling in these circumstances it is usually a good idea to remove the cache as well:
$ ml uninstall kmeans
Remove '/home/kayon/.mlhub/kmeans/' [Y/n]? y
Remove cache '/home/kayon/.mlhub/.cache/kmeans/' as well [y/N]? y
$ ml install kmeans
Commands Auto Completion
The bash shell on Linux automatically supports command line
auto-completion which is pretty handy. You can also manually download
ml.bash from MLHub and place the file into
~/.local/share/bash-completion/completions/
for recent versions of
bash, or into the system-wide location /etc/bash_completion.d/
. The
configure command automatically installs the file
into the system-wide location. Be sure to restart the shell for the
auto-completion to take effect.
Auto completion works for both MLHub commands and the names of MLHub packages.
Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0