.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_auto_examples/aequilibrae_project/plot_avoiding_spatialite_download.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr__auto_examples_aequilibrae_project_plot_avoiding_spatialite_download.py: .. _avoid_spatialite_download_windows: Avoiding the automatic download of SpatiaLite binaries on Windows ================================================================= In this example, we show how to prevent Windows from downloading the SpatiaLite binaries automatically. This may be relevant to users in corporate environments where the download and use of binaries to the Windows temporary is restricted. Spatialite Logo by Massimo Zedda, image from https://www.gaia-gis.it/ .. GENERATED FROM PYTHON SOURCE LINES 16-27 .. code-block:: Python # Imports import os from os.path import join from tempfile import gettempdir from uuid import uuid4 from aequilibrae.utils.create_example import create_example .. GENERATED FROM PYTHON SOURCE LINES 29-36 .. code-block:: Python from aequilibrae.utils.spatialite_utils import set_known_spatialite_folder, ensure_spatialite_binaries # First we prevent Windows from downloading spatialite binaries during this session # THIS VALUE MUST BE UPPER CASE TO BE EFFECTIVE os.environ["AEQ_SPATIALITE_DIR"] = r"C:\path\to\existing\download" .. GENERATED FROM PYTHON SOURCE LINES 37-38 Now we can go about our business as usual .. GENERATED FROM PYTHON SOURCE LINES 38-40 .. code-block:: Python project = create_example(join(gettempdir(), uuid4().hex)) project.close() .. rst-class:: sphx-glr-script-out .. code-block:: none This project at /tmp/81bbe8e2438449d8853114a2e33611b7 is already closed .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.206 seconds) .. _sphx_glr_download__auto_examples_aequilibrae_project_plot_avoiding_spatialite_download.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_avoiding_spatialite_download.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_avoiding_spatialite_download.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_avoiding_spatialite_download.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_