py-pip


Namepy-pip JSON
Version 0.0.11 PyPI version JSON
download
home_pageNone
Summarya PIP wrapper to install PyPI packages from inside Python
upload_time2024-04-29 11:25:35
maintainerNone
docs_urlNone
authorHannes
requires_python>=3.4
licenseNone
keywords manager dcc app
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # py-pip ![PyPI - Version](https://img.shields.io/pypi/v/py-pip)

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
```python
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.  

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

### similar
Python pip wrappers, but without passing sys paths.

- 100⭐ [di/pip-api](https://github.com/di/pip-api) - local `pip.exe` wrapper, lacks documentation (passes env vars, but not sys path, see [code](https://github.com/di/pip-api/blob/master/pip_api/_call.py))
- 004⭐ [aescarias/pypiwrap](https://github.com/aescarias/pypiwrap) - API wrapper for the PyPI website, not for local `pip.exe` [documentation](https://aescarias.github.io/pypiwrap/)
- 130⭐ [sjkingo/virtualenv-api](https://github.com/sjkingo/virtualenv-api) - local `pip.exe` wrapper, but for virtual env , nice quickstart docs on [README](https://github.com/sjkingo/virtualenv-api/blob/master/README.rst)
- 7k⭐ [pypa/pipx](https://github.com/pypa/pipx) TODO investigate
- TODO add support for pip auto remove - remove unused dependencies https://github.com/invl/pip-autoremove (does this use it s own uninstall, or can we get a list and use py-pip uninstall)

### used by
- [pip-qt](https://github.com/hannesdelbeke/pip-qt)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "py-pip",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.4",
    "maintainer_email": null,
    "keywords": "manager, dcc, app",
    "author": "Hannes",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9b/22/805db315b9bfc4f9aeceacf941e0d08fd075e9a5b1c3a81638ebfe1b45e5/py_pip-0.0.11.tar.gz",
    "platform": null,
    "description": "# py-pip ![PyPI - Version](https://img.shields.io/pypi/v/py-pip)\n\nInstall Python packages, from inside a Python environment. e.g. in Blender, Maya, Max, ...   \n  \nThe difference with similar solutions: py-pip passes it's sys.paths to pip, to support dynamicly added paths for e.g. Maya, Blender, ...  \n(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)  \n\n### Features\n- pass env vars so pip can detect installed modules in different locations (e.g. Blender dynamicaly changes the Python path on startup)  \n  & handle env vars, to prevent non sys.path paths being passed.\n- use pip from within Python, using the active interpreter\n\n### Instructions\n```python\nimport py_pip\n\n# optional\npy_pip.default_target_path = \"C:/path/to/site-packages\"  # defaults to no target path\npy_pip.python_interpreter = \"C:/path/to/python.exe\"  # defaults to sys.executable\n\n# the core commands\npy_pip.install(\"dummy_test\")  # install dummy_test\npy_pip.uninstall(\"dummy_test\")  # uninstall the dummy_test package\n```\n\n### use case\nBlender doesn't has an external Python interpreter that sets up the Blender environment (Maya has `mayapy.exe`).   \nTo use pip and have it correctly detect the installed modules:\n- you need to run it from inside Blender.\n- or recreate the environment, with same Python version and Python paths.\n\nElse you might install a module that is already by default installed in Blender, because pip failed to detect it.  \nThis can result in clashes and weird bugs.  \n\nThis might (untested) also be achievable by passing `sys.path` to `os.environ[\"PYTHONPATH\"]` and then running one of the below \"similar\" pip wrappers\n\n### similar\nPython pip wrappers, but without passing sys paths.\n\n- 100\u2b50 [di/pip-api](https://github.com/di/pip-api) - local `pip.exe` wrapper, lacks documentation (passes env vars, but not sys path, see [code](https://github.com/di/pip-api/blob/master/pip_api/_call.py))\n- 004\u2b50 [aescarias/pypiwrap](https://github.com/aescarias/pypiwrap) - API wrapper for the PyPI website, not for local `pip.exe` [documentation](https://aescarias.github.io/pypiwrap/)\n- 130\u2b50 [sjkingo/virtualenv-api](https://github.com/sjkingo/virtualenv-api) - local `pip.exe` wrapper, but for virtual env , nice quickstart docs on [README](https://github.com/sjkingo/virtualenv-api/blob/master/README.rst)\n- 7k\u2b50 [pypa/pipx](https://github.com/pypa/pipx) TODO investigate\n- TODO add support for pip auto remove - remove unused dependencies https://github.com/invl/pip-autoremove (does this use it s own uninstall, or can we get a list and use py-pip uninstall)\n\n### used by\n- [pip-qt](https://github.com/hannesdelbeke/pip-qt)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "a PIP wrapper to install PyPI packages from inside Python",
    "version": "0.0.11",
    "project_urls": {
        "Homepage": "https://github.com/hannesdelbeke/py-pip",
        "Source": "https://github.com/hannesdelbeke/py-pip"
    },
    "split_keywords": [
        "manager",
        " dcc",
        " app"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e107b455f6fec74a7666ba5a3379e46f7bcf82859a11be5beb2577afc24b15f2",
                "md5": "ad3dc1116974ffd4013a7968c4ff1fb6",
                "sha256": "c7f730ff04af3b00b17e5d9d66bdefb650dddac63bf477883a84baf81cefb709"
            },
            "downloads": -1,
            "filename": "py_pip-0.0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ad3dc1116974ffd4013a7968c4ff1fb6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.4",
            "size": 5389,
            "upload_time": "2024-04-29T11:25:33",
            "upload_time_iso_8601": "2024-04-29T11:25:33.964354Z",
            "url": "https://files.pythonhosted.org/packages/e1/07/b455f6fec74a7666ba5a3379e46f7bcf82859a11be5beb2577afc24b15f2/py_pip-0.0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9b22805db315b9bfc4f9aeceacf941e0d08fd075e9a5b1c3a81638ebfe1b45e5",
                "md5": "50e31c036a1739d40481930d131ab250",
                "sha256": "03ccd74b9c11db1854d2dc33d719c4fa8f29c22f3deead1fa8f2ea4736a4de05"
            },
            "downloads": -1,
            "filename": "py_pip-0.0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "50e31c036a1739d40481930d131ab250",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.4",
            "size": 7430,
            "upload_time": "2024-04-29T11:25:35",
            "upload_time_iso_8601": "2024-04-29T11:25:35.418971Z",
            "url": "https://files.pythonhosted.org/packages/9b/22/805db315b9bfc4f9aeceacf941e0d08fd075e9a5b1c3a81638ebfe1b45e5/py_pip-0.0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 11:25:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hannesdelbeke",
    "github_project": "py-pip",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "py-pip"
}
        
Elapsed time: 0.24031s