Add path module for path related variables
MODIFY
clear_trakt_collections.py
clear_trakt_collections.py
# dangerous!
import trakt
import sys
-from os import path
-trakt.core.CONFIG_PATH = path.join(path.dirname(path.abspath(__file__)), ".pytrakt.json")
+from plex_trakt_sync.path import pytrakt_file
+trakt.core.CONFIG_PATH = pytrakt_file
import trakt.users

MODIFY
config.py
config.py
import json
-from os import path
+from plex_trakt_sync.path import config_file
-config_file = path.join(path.dirname(path.abspath(__file__)), "config.json")
with open(config_file, 'r') as fp:
CONFIG = json.load(fp)
\ No newline at end of file

MODIFY
get_env_data.py
get_env_data.py
import trakt
import trakt.core
import trakt.users
+from plex_trakt_sync.path import pytrakt_file, env_file
-trakt.core.CONFIG_PATH = path.join(path.dirname(path.abspath(__file__)), ".pytrakt.json")
-env_file = path.join(path.dirname(path.abspath(__file__)), ".env")
+trakt.core.CONFIG_PATH = pytrakt_file
plex_needed = utils.input_yesno("-- Plex --\nAre you logged into this server with a Plex account?")
if plex_needed:

MODIFY
main.py
main.py
import plexapi.server
from os import getenv, path
import trakt
-trakt.core.CONFIG_PATH = path.join(path.dirname(path.abspath(__file__)), ".pytrakt.json")
+from plex_trakt_sync.path import pytrakt_file, env_file
+trakt.core.CONFIG_PATH = pytrakt_file
import trakt.movies
import trakt.tv
import trakt.sync
import requests_cache
requests_cache.install_cache('trakt_cache')
-env_file = path.join(path.dirname(path.abspath(__file__)), ".env")
trakt_post_wait = 1.2 # delay in sec between trakt post requests to respect rate limit

ADD
plex_trakt_sync/path.py
+from os.path import dirname, abspath, join
+
+app_path = dirname(dirname(abspath(__file__)))
+config_file = join(app_path, "config.json")
+pytrakt_file = join(app_path, ".pytrakt.json")
+env_file = join(app_path, ".env")

Add path module for path related variables