سؤال

Is there a way to use numpy from a local directory without adding the directory to the path for python? I am asking because I am running jobs on condor on machines that do not have numpy installed. I have no way of directly adding numpy to these machines, and I do not believe I can change the path on these machines. I have looked at How to tell Condor to dispatch jobs only to machines on the cluster, that have "numpy" installed on them? regarding determining if a machine has numpy, and I would prefer to run on all machines if possible, and I'm not sure I can alter the machine's classId anyway.

هل كانت مفيدة؟

المحلول

You should always be able to use

import sys
sys.path.append("/path/to/local/numpy")
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top