June 15, 2019

Prerequisites

A project/library/code that you want to make available in all your other python projects

A conda installation

Steps

Open your library that you want to make globally available using your favorite terminal Switch to the target conda environment, for me it is called “tut”

activate tut

Make the code globally available using the conda develop command.

conda develop .

Install a Python package in ‘development mode’. — “conda docs”

Test your local library installation

In my case my test library just is a directory with one file called “functionality.py” and one function that reverses strings.

Now, open a terminal somewhere else, open python and type

from functionality import reversestring reversestring ( "Gandalf" )

Use cases

For me there are specific things that I always do over and over again in Python. Keeping a git repo with a library that contains all that random stuff might be useful for you too. With the technique presented in this short guide this can easily be realized.