Skip to main content

py-pip PyPI - Version

Install Python packages, from inside a Python environment. e.g. in Blender, Maya, Max, ...

The difference with similar solutions: py-pip passes it's sys.paths to pip, to support dynamicly added paths for e.g. Maya, Blender, ...
(Otherwise any python paths added after startup wont be detected by pip, so it can't uninstall certain installed packages, or it might install an already installed package)

Features

  • pass env vars so pip can detect installed modules in different locations (e.g. Blender dynamicaly changes the Python path on startup)
    & handle env vars, to prevent non sys.path paths being passed.
  • use pip from within Python, using the active interpreter

Instructions

import py_pip

# optional
py_pip.default_target_path = "C:/path/to/site-packages"  # defaults to no target path
py_pip.python_interpreter = "C:/path/to/python.exe"  # defaults to sys.executable

# the core commands
py_pip.install("dummy_test")  # install dummy_test
py_pip.uninstall("dummy_test")  # uninstall the dummy_test package

use case

Blender doesn't has an external Python interpreter that sets up the Blender environment (Maya has mayapy.exe).
To use pip and have it correctly detect the installed modules:

  • you need to run it from inside Blender.
  • or recreate the environment, with same Python version and Python paths.

Else you might install a module that is already by default installed in Blender, because pip failed to detect it.
This can result in clashes and weird bugs.

Alternatives

This might (untested) also be achievable by passing sys.path to os.environ["PYTHONPATH"] and then running one of the below modules.

Existing Python pip wrappers, without handling sys paths by default:

  • 100⭐ di/pip-api - local pip.exe wrapper, lacks documentation (passes env vars, but not sys path, see code)
  • 004⭐ aescarias/pypiwrap - API wrapper for the PyPI website, not for local pip.exe documentation
  • 130⭐ sjkingo/virtualenv-api - local pip.exe wrapper, but for virtual env , nice quickstart docs on README
  • 7k⭐ pypa/pipx pip wrapper meant for commandline python apps. not really usefull for our use case.

TODO

used by

Metadata

Release files for py-pip 0.0.12

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

Source distribution (sdist)

Source distribution for py-pip 0.0.12
File Size Uploaded
py_pip-0.0.12.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-pip 0.0.12
File Interpreter ABI Platform
py_pip-0.0.12-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / py_pip-0.0.12.tar.gz

Download URL py_pip-0.0.12.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9411feae7342c2b6e12a105c2a4d4b667a5c1d3f134e4d898bb0dd869f1c24bb
BLAKE2b-256 checksum
How to use checksums
77e027277a3dcbd6f80d9a4606348720abe89b81fbc8079b7288771cb4f8639b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release files / py_pip-0.0.12-py3-none-any.whl

Download URL py_pip-0.0.12-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72182f5b9a21c5d953fb5c9df4ad9b0de4686ea89834d5287648fa890f37bf22
BLAKE2b-256 checksum
How to use checksums
be03510be3a48c837e467e50db1276074cc42c5d70e022c74197cc6931fdbcba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.0.12 This release

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

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