I am trying to import pyroscope module which is residing in my ~/lib/pyroscope directory. The example here shows that the script use from pyrocore.scripts import base. I don’t see any tricks based on imp.load_source. So I am kinda puzzled – what kind of environment I have to build in order to import this module(without relocating the library)?
I am trying to import pyroscope module which is residing in my ~/lib/pyroscope directory.
Share
You have to make sure that
~/libis in the path python uses to look for libraries. One way to do this is set thePYTHONPATHenvironment variable in a shell:Alternatively, you can change the path in your script before the
import:For more information, please have a look at The Module Search Path in the documentation.