Using Wing with pipenv


Wing Pro Screenshot Wing Pro Screenshot

Wing is a Python IDE that can be used to develop, test, and debug Python code running in a Python environment managed by pipenv.

If you do not already have Wing installed, download it now.

This document describes how to configure Wing for pipenv. To get started using Wing as your Python IDE, please refer to the tutorial in Wing's Help menu or read the Quickstart Guide.

Creating a New Pipenv

Wing can create a new pipenv at the same time that you create a new project. To do this, select New Project from the Project menu and choose the source directory to use with your new project with the New directory, Existing directory, or Clone repository card. Then, under Python, set Environment to New Env and Manager to pipenv.

Wing uses your selected source directory as the pipenv directory. You can optionally enter the following values:

Packages to Install lets you specify packages to install into the new virtualenv. This is either a space-separated list of pip package specifications under Package Names, or a Package File: a requirements.txt, Pipfile, environment.yml, or pyproject.toml. Package specifications may be anything accepted by pip, such as a package name, package==version, and package>=version.

Python Executable selects the base Python installation to use. You will need to install pip into this Python installation if not already present. If pipenv is not installed, Wing says so and offers to install it. See Creating Python Environments for details.

After submitting the New Project dialog, Wing will create the pipenv, set the Python Executable in Project Properties to the command that activates the environment, and add the source directory to the project.

Now source analysis, executing, debugging, and testing in Wing will use the new pipenv, as long as the project you just created is open.

Using an Existing Pipenv

To use an existing pipenv with Wing, simply select the pipenv as your source directory with the Existing directory card in the New Project dialog. Wing will automatically detect that this directory contains a pipenv and select it under Python, with Environment set to Existing Env. Wing asks pipenv where the environment is, so this also works when pipenv keeps it outside of the source directory.

Wing activates the environment each time it runs Python, whether Python Executable is set to Activated Env or to Command Line with the environment's Python.

Working on a Remote Host

Wing can also create a new pipenv on a remote host. This is done the same way as described above, except you first need to choose or create a remote host configuration from the Host menu in the New Project dialog, after pressing All Options if it is shown.

If you are using a pipenv on the remote host, Wing will update the remote host configuration to use the virtualenv created by pipenv (rather than the base Python installation).

Package Management

Once you've configured your project to use pipenv, you can use the Packages tool in the Tools menu to list, add, remove, or update packages. See Package Manager for details.

Related Documents

For more information see: