Thank you. I managed to get it to work in the end, but not using the proposed method.
Firstly, appending the sys.path with an existing installed version of numpy on my computer didn’t work, I think because of the difference in the versions of python 3.7 on my computer and python 3.6 that NAP uses (I got a verbose numpy error basically saying that I’m importing numpy from the wrong python install).
Secondly, this solution will only make the library accessible on my current machine where this library installed on this hardcoded path, which means that the python scripts will break when we distribute our software to other users and other machines.
I figured I had to install numpy from within the python build in NAP. I did this in the following way:
Inside the /thirdparty/python/bin folder in the NAP directory, I executed this command to install pip:
wget -qO- https://bootstrap.pypa.io/get-pip.py | sudo ./python3.6
And then I installed numpy from within the local python build, into the local directory, like this:
sudo ./python3 -m pip install --target “…/lib/python3.6/site-packages” numpy
And now numpy can be imported within any python script in our project, and is included in the packages of our software.
What do you think of this method?
For future users that want to achieve the same, maybe it would be useful to have a simple NAP command that installs a python module for you in this manner. Would this be possible?