def create_profile(path, name):
profile_name = get_conda_env()
prefix = sys.exec_prefix
cmd = "%s profile create --parallel --profile=%s --ipython-dir=%s" % \
(os.path.join(prefix, BIN_DIR[platform.system()], "ipython"), profile_name, path)
print(cmd)
status = os.system(cmd)
if status:
return status
shutil.copy(os.path.join(os.path.dirname(os.path.abspath(__file__)), "ipcluster_config.py"),
os.path.join(path, "profile_%s" % profile_name, "ipcluster_config.py"))
config = {
"environment": {
"CONDA_DEFAULT_ENV": profile_name
}
}
with codecs.open(os.path.join(path, "profile_%s" % profile_name, "config.json"), "w", encoding="utf-8") as f:
json.dump(config, f)
评论列表
文章目录