Common Errors#

Windows Specific Errors#

Windows execution policy in PowerShell#

Some times a Windows setup has disabled default execution policies.

This happens when you find an error message looking like:

AuthorizationManager check failed.
At line:1 char:1
+ C:\scriptpath\scriptname.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Or, something similar (depending on versions etc.)

To enable execution do the following:

  1. Open PowerShell in administrator mode: Search for powershell in the windows search bar

  2. Select Run as administrator

  3. Execute this code:

    Set-ExecutionPolicy Unrestricted
    

    Important: Press A when asked (not Y)!

Restart any terminals (including VS Code) and try again.

Click here to get more information about execution policies.

ImportError: DLL load failed ...#

When importing dtumathtools some Windows machines are missing certain libraries.

The error can look similar to this:

ImportError: DLL load failed while importing _cext: The specified module could not be found
  1. Click here and download (most likely) the X64 one.

  2. Install the application

  3. Re-start your editor (or machine) and try again If it still does not work, then try the X86 version.

  4. If problems still occur, please write us at pythonsupport@dtu.dk

ERROR: Could not install packages due to an OSError: ...#

The exact error message can look different depending on when you encounter this error. It happens because of a default limitation of 260 characters in file names.

The remedy is quite simple, download this script and double-click it.

Now try to install the packages again.

Setting default terminal in VS code ( Windows )#

The default terminal in VS Code can be changed in the following way:

  1. Open a terminal in VS Code

  2. Next to the + icon select the downwards arrow

  3. Click Select Default Profile

  4. Choose the terminal, that you wish to have as your default (Windows PowerShell is recommended)