You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

When running Python model adapters within FEWS, Python should be installed on your system and the dependencies (Python packages) of your adapter as well. The proposed way to do this is to:

  • work in virtual environment
  • organize model adapter code as python package
  • make sure that all dependencies are listed in the setup.py of the package, to allow straightforward installation

Working with virtual environment

A Python virtual environment, put simply, is an isolated working copy of Python which allows you to work on a specific project without worry of affecting other projects. You can have multiple virtual environments on your system, all having their own specific (versions of) packages available. The virtualenv package provides the basic needs, but virtualenvwrapper makes life a bit easier.

 More information on installation and use can be found in the documentation:

virtualenv

virtualenvwrapper

Use virtualenvwrapper-win on a windows system (https://pypi.python.org/pypi/virtualenvwrapper-win)

Create Python package

The python scaffold package (https://pypi.python.org/pypi/Scaffold/0.1.1) helps to create a proper directory structure for your package

  • No labels