From d7ec888d687725d47b8789578f0bd96876b475b4 Mon Sep 17 00:00:00 2001 From: navanchauhan Date: Sun, 7 Aug 2022 22:54:35 -0400 Subject: rebuild --- docs/posts/2020-07-01-Install-rdkit-colab.html | 141 +++++++++++++------------ 1 file changed, 74 insertions(+), 67 deletions(-) (limited to 'docs/posts/2020-07-01-Install-rdkit-colab.html') diff --git a/docs/posts/2020-07-01-Install-rdkit-colab.html b/docs/posts/2020-07-01-Install-rdkit-colab.html index bf1da97..56e2f21 100644 --- a/docs/posts/2020-07-01-Install-rdkit-colab.html +++ b/docs/posts/2020-07-01-Install-rdkit-colab.html @@ -76,76 +76,83 @@ rdkit_version=None, add_python_path=True, force=False): - """install rdkit from miniconda - ``` - import rdkit_installer - rdkit_installer.install() - ``` - """ - - python_path = os.path.join( - conda_path, - "lib", - "python{0}.{1}".format(*sys.version_info), - "site-packages", - ) - - if add_python_path and python_path not in sys.path: - logger.info("add {} to PYTHONPATH".format(python_path)) - sys.path.append(python_path) - - if os.path.isdir(os.path.join(python_path, "rdkit")): - logger.info("rdkit is already installed") - if not force: - return - - logger.info("force re-install") - - url = url_base + file_name - python_version = "{0}.{1}.{2}".format(*sys.version_info) - - logger.info("python version: {}".format(python_version)) - - if os.path.isdir(conda_path): - logger.warning("remove current miniconda") - shutil.rmtree(conda_path) - elif os.path.isfile(conda_path): - logger.warning("remove {}".format(conda_path)) - os.remove(conda_path) - - logger.info('fetching installer from {}'.format(url)) - res = requests.get(url, stream=True) - res.raise_for_status() - with open(file_name, 'wb') as f: - for chunk in res.iter_content(chunk_size): - f.write(chunk) - logger.info('done') - - logger.info('installing miniconda to {}'.format(conda_path)) - subprocess.check_call(["bash", file_name, "-b", "-p", conda_path]) - logger.info('done') - - logger.info("installing rdkit") - subprocess.check_call([ - os.path.join(conda_path, "bin", "conda"), - "install", - "--yes", - "-c", "rdkit", - "python=={}".format(python_version), - "rdkit" if rdkit_version is None else "rdkit=={}".format(rdkit_version)]) - logger.info("done") - - import rdkit - logger.info("rdkit-{} installation finished!".format(rdkit.__version__)) - - -if __name__ == "__main__": - install() + """install rdkit from miniconda + -
+
import rdkit_installer
+rdkit_installer.install()
+```
+"""
+
+python_path = os.path.join(
+    conda_path,
+    "lib",
+    "python{0}.{1}".format(*sys.version_info),
+    "site-packages",
+)
+
+if add_python_path and python_path not in sys.path:
+    logger.info("add {} to PYTHONPATH".format(python_path))
+    sys.path.append(python_path)
+
+if os.path.isdir(os.path.join(python_path, "rdkit")):
+    logger.info("rdkit is already installed")
+    if not force:
+        return
+
+    logger.info("force re-install")
+
+url = url_base + file_name
+python_version = "{0}.{1}.{2}".format(*sys.version_info)
+
+logger.info("python version: {}".format(python_version))
+
+if os.path.isdir(conda_path):
+    logger.warning("remove current miniconda")
+    shutil.rmtree(conda_path)
+elif os.path.isfile(conda_path):
+    logger.warning("remove {}".format(conda_path))
+    os.remove(conda_path)
+
+logger.info('fetching installer from {}'.format(url))
+res = requests.get(url, stream=True)
+res.raise_for_status()
+with open(file_name, 'wb') as f:
+    for chunk in res.iter_content(chunk_size):
+        f.write(chunk)
+logger.info('done')
+
+logger.info('installing miniconda to {}'.format(conda_path))
+subprocess.check_call(["bash", file_name, "-b", "-p", conda_path])
+logger.info('done')
+
+logger.info("installing rdkit")
+subprocess.check_call([
+    os.path.join(conda_path, "bin", "conda"),
+    "install",
+    "--yes",
+    "-c", "rdkit",
+    "python=={}".format(python_version),
+    "rdkit" if rdkit_version is None else "rdkit=={}".format(rdkit_version)])
+logger.info("done")
+
+import rdkit
+logger.info("rdkit-{} installation finished!".format(rdkit.__version__))
+
+ +

if name == "main": + install() +```

+ + +
+ +
+ -- cgit v1.2.3