       options.env["MYPYPATH"] = ''
     ##Prepend user setting defined MYPYPATH to current system env MYPYPATH
     if @mypyPath?
-      mypyPathResolved = @mypyPath
-      [projectPath, ...] = atom.project.relativizePath(filePath)
-      if projectPath
-        projectName = path.parse(projectPath).base
-        mypyPathResolved = mypyPathResolved.replace(/\$PROJECT_PATH/g, projectPath).replace(/\$PROJECT_NAME/g, projectName)
+      mypyPathResolved = @resolvePath @mypyPath, filePath
       options.env["MYPYPATH"] = ':' + mypyPathResolved + ':' + options.env["MYPYPATH"] + ':'
     ##Add current folder of the file being linted to MYPYPATH
     options.env["MYPYPATH"] = options.env["MYPYPATH"].replace(/:\.:/g, ':' + rootPath + ':')

          return []

  resolvePath: (targetPath, filepath) ->
    resolvedPath = targetPath

    if not filepath
      return resolvedPath

    [projectPath, ...] = atom.project.relativizePath(filepath)
    if not projectPath
      return resolvedPath
    projectName = path.parse(projectPath).base
    resolvedPath = resolvedPath.replace(/\$PROJECT_NAME/g, projectName)
    resolvedPath = resolvedPath.replace(/\$PROJECT_PATH/g, projectPath)
    return resolvedPath

    ## We want column number so that we can know where to underline.
    params.push("--show-column-numbers")

    iniPath = @resolvePath @mypyIniFile, filePath

    if (fs.existsSync iniPath)
      # Use the provided mypy configuration file.
