Commit 1aceb017 authored by Mark Daoust's avatar Mark Daoust
Browse files

Robust "PYTHONPATH" usage.

parent 1056788e
......@@ -165,8 +165,8 @@
},
"cell_type": "code",
"source": [
"! pip install requests\n",
"! git clone --depth 1 https://github.com/tensorflow/models"
"! pip install requests\n",
"! git clone --depth 1 https://github.com/tensorflow/models"
],
"execution_count": 0,
"outputs": []
......@@ -247,7 +247,10 @@
"#export PYTHONPATH=${PYTHONPATH}:\"$(pwd)/models\"\n",
"#running from python you need to set the `os.environ` or the subprocess will not see the directory.\n",
"\n",
"os.environ['PYTHONPATH'] += os.pathsep + models_path"
"if \"PYTHONPATH\" in os.environ:\n",
" os.environ['PYTHONPATH'] += os.pathsep + models_path\n",
"else:\n",
" os.environ['PYTHONPATH'] = models_path"
],
"execution_count": 0,
"outputs": []
......@@ -1394,4 +1397,4 @@
]
}
]
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment