1. Installing PyPop

Attention

The package name for installation purposes is pypop-genomics - to avoid conflicting with an unrelated package with the name pypop already on PyPI.

1.1. Quickstart Guide

Installing pypop-genomics

If you already have Python and pip installed, install using the following:

pip install pypop-genomics

Otherwise, follow these instructions to install Python 3 and pip.

Once pypop-genomics is installed, depending on your platform, you may also need to adjust your PATH environment variable.

Upgrading pypop-genomics

pip install -U pypop-genomics

Uninstalling pypop-genomics

pip uninstall pypop-genomics

For more, including handling common installation issues, see the detailed installation instructions .

Once you have installed pypop-genomics, you can move on to try some example runs.

1.2. Examples

These are examples of how to check that the program is installed and some minimal use cases.

Checking version and installation

pypop --version

This simply reports the version number and other information about PyPop, and indirectly checks that the program is installed. If all is well, you should see something like:

pypop 1.0.0
[Python 3.10.9 | Linux.x86_64-x86_64 | x86_64]
Copyright (C) 2003-2006 Regents of the University of California.
Copyright (C) 2007-2023 PyPop team.
This is free software.  There is NO warranty; not even for
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You can also run pypop --help to see a full list and explanation of all the options available.

Run a minimal dataset:

Download test .ini and .pop files: minimal.ini and USAFEL-UchiTelle-small.pop. You can then run them

pypop -c  minimal.ini USAFEL-UchiTelle-small.pop

If you have already cloned the git repository and it is your working directory, you can simply run

pypop -c  tests/data/minimal.ini tests/data/USAFEL-UchiTelle-small.pop

This will generate the following two files, an XML output file and a plain text version:

USAFEL-UchiTelle-small-out.xml
USAFEL-UchiTelle-small-out.txt

1.3. Detailed installation instructions

There are three main steps:

  1. install Python and pip

  2. install package from Test PyPI

  3. adjusting your PATH variable after installation

Install Python 3 and pip

A full description of installing Python and pip on your system is beyond the scope of this guide, we recommend starting here:

Here are some additional platform-specific notes that may be helpful:

  • Most Linux distributions come with Python 3 preinstalled. On most modern systems, pip and python will default to Python 3.

  • MacOS 10.9 (Jaguar) up until 12.3 (Catalina), used to ship with Python 2 pre-installed, but it now has to be manually installed. See the MacOS quick-start guide in the official documentation for how to install Python 3. (Note that if Python is installed on Mac via the MacOS developer tools, it may include the version 3 suffix on commands, e.g. python3 and pip3, so modify the below, accordingly).

  • For Windows, see also the Windows quick-start guide in the official documentation. Running python in the Windows command terminal in Windows 11 and later will launch the installer for the Microsoft-maintained Windows package of Python 3.

Install package from PyPI

Once you have both python and pip installed, you can use pip to install pre-compiled binary “wheels” of pypop-genomics directly from PyPI.

pip install pypop-genomics

Note

If, for whatever reason, you cannot use the these binaries (e.g. the pre-compiled binaries are not available for your platform), you may need to follow the developer installation instructions in the contributors guide.

Upgrade an existing PyPop installation

To update an existing installation to a newer version, use the same command as above, but add the --upgrade (short version: -U) flag, i.e.

pip install -U pypop-genomics

Installing from Test PyPI

From time to time, we may make available packages on the Test PyPI instance, rather than the through the main instance. The above installation and updating instructions can be used, by appending the following:

--extra-index-url https://test.pypi.org/simple/

to the above pip commands.

Issues with installation permission

By default, pip will attempt to install the pypop-genomics package wherever the current Python installation is installed. This location may be a user-specific virtual environment (like conda, see below), or a system-wide installation. On many Unix-based systems, Python will generally already be pre-installed in a “system-wide” location (e.g. under /usr/lib) which is read-only for regular users. (This can also be true for system-installed versions of Python on Windows and MacOS.)

When pip install cannot install in a read-only system-wide location , pip will gracefully “fall-back” to installing just for you in your home directory (typically ~/.local/lib/python<VER> where <VER> is the version number of your current Python). In general, this is what is wanted, so the above instructions are normally sufficient.

However, you can also explicitly set installation to be in the user directory, by adding the --user command-line option to the pip install command, i.e.:

pip install pypop-genomics --user

This may be necessary in certain cases where pip install doesn’t install into the expected user directory.

Installing within a conda environment

In the special case that you installing from within an activated user-specific conda virtual environment that provides Python, then you should not add the --user because it will install it in ~/.local/lib/ rather than under the user-specific conda virtual environment in ~/.conda/envs/.

Post-install PATH adjustments

You may need to adjust the PATH settings (especially on Windows) for the pypop scripts to be visible when run from your console application, without having to supply the full path to the pypop executable file.

Warning

Pay close attention to the “WARNINGS” that are shown during the pip installation, they will often note which directories need to be added to the PATH.

  • On Linux and MacOS, systems this is normally fairly simple and only requires edit of the shell .profile, or similar and addition of the $HOME/.local/bin to the PATH variable, followed by a restart of the terminal.

  • For Windows, however, as noted in most online instructions, this may need additional help from your system administrator if your user doesn’t have the right permissions, and also require a system reboot.

Uninstalling PyPop

To uninstall the current version of pypop-genomics:

pip uninstall pypop-genomics

1.4. Support and development

Please submit any bug reports, feature requests or questions, via our GitHub issue tracker (see our bug reporting guidelines for more details on how to file a good bug report):

Please do not report bugs via private email to developers.

The development of the code for PyPop is via our GitHub project: