Skip to content

Instantly share code, notes, and snippets.

@Justintime50
Created May 28, 2020 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Justintime50/115eca9e28bd3e81b991c3749c32e71f to your computer and use it in GitHub Desktop.
Save Justintime50/115eca9e28bd3e81b991c3749c32e71f to your computer and use it in GitHub Desktop.
Import a Relative Module in Python

Import a Relative Module in Python

This is great when testing a local version of something like a client library and you need to test your changes and not import the globally installed version.

Usage

import sys
sys.path.insert(0, "/path/to/your/package_or_module")
import my_module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment