You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that here is no 3. The AppImage can be readily used as so,
as a standardpython binary. For, example to start a session:
> ./python3-x86_64.AppImage
Python 3.7.3 (default, Jun 7 2019, 19:11:26)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Usage
There are several schemes (workflows) that you can follow using the
PythonAppImage.
The --user scheme (novice)
Any Pythonexecutable package installed inside the
AppImage is accessible using the classical -m option, E.g.:
Note that since the AppImage is read-only, extra packages or
upgrades must be installed following the --user scheme, i.e. to your $HOME.
If you follow this workflow you'd probably create wrappers or aliases for common
commands, E.g. pip.
The virtual env scheme (medium)
Using a Python 3AppImage you can create a virtual env
from the downloaded image, E.g. as:
./python3-x86_64.AppImage -m venv ENV
Then, one can follow the usual workflow with a virtual env. Note that there
are two caveats though:
Only venv is supported, limiting this functionality to Python 3.
The design of virtualenv makes it difficult to run from an
AppImage.
venv does not manage to install pip when creating the virtual
environment. This can however be done afterwards, from within the env as:
[ENV] > python -m ensurepip
The embeded scheme (expert)
The AppImage can be used as an engine in order to power a
Python based project, a framework or simply a clean workspace. One can
get a relocatable and isolated higher level application by using the following
layout:
By following this layout, Python will search and install any extra
packages in the created site-packages directories. Executable scripts will
be installed to the bin/ directories, which must be added to your $PATH.
Note that the user/ directory is optional. There can be several as well, E.g.
grouped in a home/ directory below Application/. By providing a user/ and
starting python with HOME=/path/to/user one creates an isolated user space,
E.g. for installing separated packages with the --user scheme.
The whole Application directory can be relocated (distributed), provided that
the site packages are relocatable. There is one extra caveat: the shebangs
(#!) created by Python, when installing a script, are absolute.
This can however easily be fixed by substititing them, E.g. with a setup.sh
script that would also configure the environment ($PATH, $HOME, ...).