Importing a Python Module from another directory

You could push the directory to Python’s sys.path and then import the module:

using PyCall
push!(pyimport("sys")."path", "/path/of/directory")
mymodule = pyimport("mymodule")
4 Likes