Python on TUNI Windows computers
Python is a programming language used in basic programming courses and in scientific computing. There is a wide range of additional add-ons called libraries available for Python. The optimal method to install Python depends on your requirements.
With these instructions you can install Python on a TUNI Windows computer. See separate instructions for using Python on on TUNI Mac computers or TUNI Linux computers.
Basic Python installation
There is a basic Python installation in Windows student computer labs. Some labs also have an editor called PyCharm installed. This same package is available also for staff computers. It is primarily intended for teachers of the basic programming courses. The software versions are automatically updated following the same schedule than the installations in student computer labs.
It is possible to install additional libraries to this installation. Advanced users can utilise the command pip. When used with normal user rights, it will make a per-user installation of the library, and does not need administrative privileges. Example command to install a new library with pip: pip install --user library_name
If you want this basic Python installation and PyCharm editor on your work computer, install packages ”Python” and ”PyCharm” from Software Center.
Some libraries that have been installed with pip contain program binaries (.exe). On TUNI Windows computers that are in the default management model called "Easy", to enable running such self-installed .exe binaries bundled with the libraries, a configuration package called "Applocker - DevApps" needs to be installed from Software Center.
Additional Python libraries related to teaching
Additional Python libraries have been installed to the student lab computers based on teachers’ requests. The same library package is available for staff computers. List of those libraries in on the page Python in the software list.
If you install this library package on your work computer, note that the package will be updated in the same schedule as on the student lab computers. Such update will uninstall all libraries that are installed system-wide (with admin rights). Libraries that have been installed using the --user parameter of the pip command will not be uninstalled.
If you want this library package on your work computer, install “Python Studentlab Libraries” from Software Center.
If the update schedules for Python packages in Software Center are not good for your requirements, we suggest to use an advanced installation method, see below.
Advanced Python installation: Miniforge
If you need an advanced Python programming environment on TUNI Windows computer, we suggest to install it yourself. With this method you can choose the version of Python and libraries you need, and they will be updated on the schedule of your choice. It is, however, your responsibility to ensure all security updates are installed.
For these needs we suggest to use an open source Python installer called Miniforge. It contains a tool called conda for managing installation of additional libraries.
You can download the installer from the page: https://github.com/conda-forge/miniforge
When you start the installer (exe file), run it with your own basic user privileges. When the installer asks you to choose between per-user or per-system installation, make a per-user installation by choosing “Just Me (recommended)”.
Do not use administrator or High Flexibility rights when running the installer, even if you have those privileges. The management of additional libraries and updates will work as intended when the installation is made per user.
The software is available on a TUNI Windows workstation when it is installed in the path suggested by the installer by default, with the "Applocker - DevApps" application installed from Software Center.
Abandoning Anaconda and Miniconda
This page previously recommended Anaconda, Inc.'s Python distribution named Anaconda as the basis for an advanced Python installation. Miniconda is an installation tool also from the same company, which by default utilizes Python add-ons from Anaconda’s repository. The licensing terms for Anaconda have changed, and both the tool itself and the add-ons offered from its repositories now require a paid license. You need to obtain a license through the IT Helpdesk for their usage.
If Anaconda was previously used on the computer and has been removed, a configuration file may have been left behind, causing Miniforge to use Anaconda’s paid add-ons. This configuration file is related to the conda tool that comes with these software packages and is typically located at: C:\Users\username\.condarc, but it may also be located e.g. in a Python project’s own folder in some cases.
Disabling Anaconda's paid add-ons
Here’s how to ensure that Miniforge does not use Anaconda’s paid add-ons:
- Miniforge installation creates a shortcut "Miniforge prompt" to Start Menu. Use it to open a command prompt with conda commmand ready to use.
- Enter the command conda info to display the conda settings on the screen.
- Check if the section "channel URLs" section lists addresses with the server "repo.anaconda.com". This is the address offering paid add-ons, and it needs to be removed. "conda.anaconda.org", on the other hand, is Miniforge’s default channel and offers free content.
- If paid add-on channel is use, it is likely due to an add-on channel named "defaults" that remains from the Anaconda installation. This setting is typically in configuration file C:\Users\username\.condarc. Deleting the file is the easiest way to fix the issue. Running conda again will create a new and clean .condarc file.
If you want to preserve other conda setting changes that you may have done, and don't want to delete .condarc, you can modify the add-on channels this way:
- Check configured channels with the command conda config --show channels
- Remove the unwanted channel "defaults" with command: conda config --remove channels defaults
- If Miniforge’s default free add-on channel "conda-forge" is not in use, add it with the command: conda config --add channels conda-forge
- Finally, verify with command conda info that "repo.anaconda.com" is no longer listed in the add-on channel addresses.
IT Helpdesk
0294 520 500
it-helpdesk [at] tuni.fi (it-helpdesk[at]tuni[dot]fi)
helpdesk.tuni.fi