Mathematics, Sciences, and Technologies

“Every secret of a writer’s soul, every experience of his life, every quality of his mind is written large in his works.”
– Virginia Woolf

Python for Scientists 0-1: Setting up a Python Environment

,

Local Installation

UV

The increasingly popular way of getting a working local Python copy, in addition to a proper package management tool, is by installing UV (the guide is available at this link). Then we can create a new virtual environment using the following command in the terminal:

uv venv my-env-name --python 3.13

where my-env-name will become the name of the environment and --python indicates the version of Python to be installed (see more here). Activate it by the command that appears after making the environment. Then packages can be promptly installed like

uv pip install numpy scipy matplotlib

(see here) (You may need to move into the directory corresponding to the environment first.)

Visual Studio Code

We may also like to have a versatile code editor for convenience. My recommendation is Visual Studio Code which is readily available. After downloading it, we just need to further install the Python extension and select the custom environment as the interpreter to be used by the editor.

Google Colab

A handy alternative will be Google Colab that allows online storage, sharing, and live execution of (Python) scripts. The environment provided by Google Colab is immediately ready to use. It is particularly suitable for showcasing code samples and inviting other people to test it.

Leave a Reply

I’m Benjamin

Welcome to my Mathematical World! Here you can find posts and tutorials related to applied topics like Linear Algebra, Calculus, Differential Equations, as well as Programming. Feel free to leave comments and suggestions!

Let’s connect

Discover more from Benjamin's Maths World

Subscribe now to keep reading and get access to the full archive.

Continue reading