pyenv allows you to install multiple python versions side by side in your local user environment. This installation method is preferred over using conda to install pdm,
Follow the pyenv installation instructions here. There are just two steps.
- Download and install
pyenv - Add
pyenvfunctions to your shell configuration.
Navigate to the nuc-morph-analysis folder and install the required python version.
pyenv install $(cat .python-version)The .python-version file in this repo tells pyenv to load Python 3.9 when you are inside the nuc-morph-analysis directory.
Check that this is working with which python && python --version.
Detailed installation instructions are available here.
For Linux or MacOS, install pdm for your user as follows.
- Download the installer
curl -sSLO https://pdm.fming.dev/install-pdm.py- Validate that the installer has not been tampered with
curl -sSL https://pdm.fming.dev/install-pdm.py.sha256 | shasum -a 256 -c -- Using Python 3.9, run the installer.
python install-pdm.pyWarning
With this installation method pdm will be tied to the exact python version used to install it. If you installed with Python 3.9.13, for example, and you later transition to Python 3.9.17, do not uninstall Python 3.9.13.
pdm will be installed into $HOME/.local/bin. Check that your version is at least 2.10. We test against version 2.12.2.
$ pdm --version
PDM, version 2.12.2From the nuc-morph-analysis directory, use pdm to install the dependencies.
pdm sync -dNote
If you are on the Allen Institute for Cell Science local network, you can speed up data loading by installing aicsfiles.
Use the following steps.
pdm config --local pypi.artifactory.url https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/simplepdm config --local pypi.artifactory-snapshot.url https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-snapshot-local/simplepdm sync -d -G internal
This will create a virtual environment at nuc-morph-analysis/.venv.
It is recommended use pdm to run Python in this environment without activating it via pdm run python {options}, though you can activate it with eval $(pdm venv activate) or source .venv/bin/activate.
To modify the project dependencies, see our instructions for using pdm.
To run the tests:
pdm run pytest