module installcustom.install_custom_python

Short summary

module pymyinstall.installcustom.install_custom_python

Various functions to install python.

source on GitHub

Functions

function

truncated documentation

fix_fcntl_windows

Adds a file fnctl.py on Windows (only available on Linux).

fix_resource_windows

Adds a file resource.py on Windows (only available on Linux).

fix_termios_windows

Adds a file termios.py on Windows (only available on Linux).

folder_older_than

Tells if a folder is older than a given timespan.

install_python

Installs python. It does not do it a second time if it is already installed.

unzip7_files

If 7z is installed, the function uses it to uncompress file into 7z format. The file filename_7z

Documentation

Various functions to install python.

source on GitHub

pymyinstall.installcustom.install_custom_python.fix_fcntl_windows(path)[source]

Adds a file fnctl.py on Windows (only available on Linux).

Parameters

path – path to the python installation

source on GitHub

pymyinstall.installcustom.install_custom_python.fix_resource_windows(path)[source]

Adds a file resource.py on Windows (only available on Linux).

Parameters

path – path to the python installation

source on GitHub

pymyinstall.installcustom.install_custom_python.fix_termios_windows(path)[source]

Adds a file termios.py on Windows (only available on Linux).

Parameters

path – path to the python installation

source on GitHub

pymyinstall.installcustom.install_custom_python.folder_older_than(folder, delay=datetime.timedelta(days=30))[source]

Tells if a folder is older than a given timespan.

Parameters
  • folder – folder name

  • delay – delay

Returns

boolean

source on GitHub

pymyinstall.installcustom.install_custom_python.install_python(temp_folder='.', fLOG=<built-in function print>, install=True, force_download=False, version=None, modules=None, custom=False, latest=False, download_folder='download', verbose=False)[source]

Installs python. It does not do it a second time if it is already installed.

Parameters
  • temp_folder – where to download the setup

  • fLOG – logging function

  • install – install (otherwise only download)

  • force_download – force the downloading of python

  • version – version to download (by default the current version of Python)

  • modules – modules to install

  • custom – the standalone distribution has issue when installing new packages, custom is True means switching to a zip of the standard distribution, see below

  • latest – install this version of pymyinstall and not the pypi version

  • download_folder – download folder for packages

  • verbose – more display

Returns

temporary file

The version is fixed to the current version of Python and amd64. The standalone distribution has an issue and raises an error for some packages such as smart_open:

error: [Errno 2] No such file or directory: '<python>\python36.zip\lib2to3\Grammar.txt'

In that case, you should consider using custom=True.

Changed in version 1.1: Add parameters custom, latest, verbose.

Changed in version 1.2: Implements the version for Linux.

source on GitHub

pymyinstall.installcustom.install_custom_python.unzip7_files(filename_7z, fLOG=<built-in function print>, dest='.')[source]

If 7z is installed, the function uses it to uncompress file into 7z format. The file filename_7z must not exist.

Parameters
  • filename_7z – final destination

  • fLOG – logging function

  • dest – destination folder

Returns

output of 7z

New in version 1.1.

source on GitHub