PyInstaller with Python 3.6 and PySide2 fails on Windows 10

Pyinstaller spits out warnings lthat it could not find libraries like api-ms-win-core-* and api-ms-win-crt-*. This leads to an executable working on windows 10, even on a new machine, but not on earlier versions as pyinstaller fails to bundle the needed files.

The fix is quite simple:

  1. Download Visual Studio 2017 community from microsoft website
  2. Install following components:
    Windows Universal CRT SDK
    Windows 8.1 SDK
    VC++ 2015.3 v140 toolset for desktop
    Windows Universal C Runtime
  3. When invoking pyinstaller use
    –path "C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86"

Done 🙂

well the path is for the 32bit libraries, guess what, replace DLLs\x86 with DLLs\x64 when using python 64bit

OR install Visual C++ 2017 Redist package on the destination machine.

If the packaged application still does not run please install the mentioned redist package

USB drive not recognised (error -71)

CentOS 7 recently had an error when connecting a USB drive. I guess this came after updating to the latest kernel. The errors in dmesg or /var/log/messages were:

[ 4159.607574] usb 1-1: new full speed USB device using uhci_hcd and address 4
[ 2079.875502] usb 1-1: device descriptor read/64, error -71
[ 2080.099379] usb 1-1: device descriptor read/64, error -71
[ 2080.319263] usb 1-1: new full speed USB device using uhci_hcd and address 5
[ 2080.443858] usb 1-1: device descriptor read/64, error -71
[ 4161.322029] usb 1-1: device descriptor read/64, error -71
[ 4161.537896] usb 1-1: new full speed USB device using uhci_hcd and address 6
[ 4161.945615] usb 1-1: device not accepting address 6, error -71
[ 4162.057577] usb 1-1: new full speed USB device using uhci_hcd and address 7
[ 4162.465330] usb 1-1: device not accepting address 7, error -71

After some googleing i found a fix for that:

# vim /etc/modprobe.d/options.conf

and add following line to it:

options usbcore use_both_schemes=y

more information about what this line does can be found here.

Disable services on OSX in terminal

List all your services:

$ launchctl list

List a specific service:

$ launchctl list | grep "my service"

The result will be in the format PID / Status / Label. If PID is marked as "-" then the service is not started.

Get infos about the service:

$ sudo launchctl procinfo <PID>

or get path and domain:

$ sudo launchctl procinfo <PID> | grep -E "(domain|path)"

Now that you have the path to the plist file (path => <PLIST FILE>) and the user under which the service is started (domain => .user.XXX. => <UID>), you can disable the service by two ways: disable per user or disable systemwide.

Disable per user:

$ launchctl disable user/<UID>/<LABEL>

Disable systemwide:

$ sudo launchctl unload -w <PLIST FILE>