Skip to main content

Pipimport automatically installs missing modules using pip at import time. It is best used with virtualenv.

Just import pipimport and call install():

>>> import pipimport
>>> pipimport.install()

Now you can normally import modules that are not currently installed. Pipimport will call pip (form your virtualenv) and install it before importing.

>>> import unipath
Will install module unipath
Downloading/unpacking unipath
  Downloading Unipath-1.0.tar.gz
  Running setup.py egg_info for package unipath
Installing collected packages: unipath
  Running setup.py install for unipath
Successfully installed unipath
Cleaning up...
>>> unipath
<module 'unipath' from '/home/carles/Projectes/piphook/ve/local/lib/python2.7/site-packages/unipath/__init__.pyc'>

The modules that can’t be found are remembered so sequential imports don’t try to download them again. This list is saved in the virtualenv directory ( sys.prefix ) or in the working directory (the first with writing permissions) with the name of .pipimport-ignore . The list is loaded in subsequent sessions.

Metadata

Release files for pipimport 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pipimport 0.2.5
File Size Uploaded
pipimport-0.2.5.tar.gz 2.5 kB Details

Release files / pipimport-0.2.5.tar.gz

Download URL pipimport-0.2.5.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f0745bfb7dc6067b41324740187541fb8a1588798d8705eef317b6a8f0ad2ab0
BLAKE2b-256 checksum
How to use checksums
206fce7031a037a21711bf835d71ba5013e242ef2d37132a04739b6cfe3fb614
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.5 This release

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

0.1.1

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page