{"id":19562725,"url":"https://github.com/pyenv/pyenv-users","last_synced_at":"2025-04-27T00:31:53.948Z","repository":{"id":54369007,"uuid":"334002768","full_name":"pyenv/pyenv-users","owner":"pyenv","description":"List virtual environments that use pyenv-managed versions of Python","archived":false,"fork":false,"pushed_at":"2025-01-24T19:57:24.000Z","size":21,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-19T08:30:27.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyenv.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-01-29T01:24:18.000Z","updated_at":"2025-02-06T17:40:36.000Z","dependencies_parsed_at":"2025-04-18T22:37:17.022Z","dependency_job_id":"3cc1a2fb-49d5-451e-8de4-e2f9e5a91d34","html_url":"https://github.com/pyenv/pyenv-users","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyenv%2Fpyenv-users","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyenv%2Fpyenv-users/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyenv%2Fpyenv-users/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyenv%2Fpyenv-users/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyenv","download_url":"https://codeload.github.com/pyenv/pyenv-users/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250397275,"owners_count":21423787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T05:15:27.955Z","updated_at":"2025-04-27T00:31:53.701Z","avatar_url":"https://github.com/pyenv.png","language":"Shell","readme":"pyenv-users\n===========\n\nSearch a directory for virtual environments that use pyenv-managed versions of\nPython.\n\nI find it helpful for verifying that I can safely uninstall old Python\nversions. Unlike the `pyenv-virtualenv\n\u003chttps://github.com/pyenv/pyenv-virtualenv\u003e`_ plugin, this will list all\nvirtual environments, regardless of how they were created (``python -m venv\n\u003cvenv\u003e``, ``poetry install``, etc).\n\n\nPrerequisites\n-------------\n\n* GNU coreutils (for ``readlink`` and ``realpath``)\n\n* GNU findutils (for ``find``)\n\n\nInstallation\n------------\n\n.. code-block:: bash\n\n   $ git clone https://github.com/pyenv/pyenv-users.git \"$(pyenv root)/plugins/pyenv-users\"\n\n\nUsage\n-----\n\nRun ``pyenv users`` to search the current directory for virtual environments,\nor ``pyenv users \u003cdirectory\u003e`` to search a specific directory. For example, to\nsearch your home directory:\n\n.. code-block:: bash\n\n   $ pyenv users ~\n   3.7.9          .cache/pypoetry/virtualenvs/my_project-KM_3YcvM-py3.7\n   3.7.9          work/venvs/long name with spaces\n   3.8.6          .cache/pypoetry/virtualenvs/my_project-KM_3YcvM-py3.8\n   pypy3.6-7.3.1  work/venvs/example1\n\nFor scripting, use the ``--raw`` option to output a list of ``:`` separated\nitems. The ``--absolute-paths`` option may also be useful in this case:\n\n.. code-block:: bash\n\n   $ pyenv users --raw --absolute-paths ~\n   3.7.9:/home/peter/.cache/pypoetry/virtualenvs/my_project-KM_3YcvM-py3.7\n   3.7.9:/home/peter/work/venvs/long name with spaces\n   3.8.6:/home/peter/.cache/pypoetry/virtualenvs/my_project-KM_3YcvM-py3.8\n   pypy3.6-7.3.1:/home/peter/work/venvs/example1\n\nFor example, to get a list of all versions linked to a virtual environment:\n\n.. code-block:: bash\n\n   $ pyenv users --raw ~ | cut -d: -f1 | uniq\n   3.7.9\n   3.8.6\n   pypy3.6-7.3.1\n\nThe list of linked versions can be combined with the list of all installed\nversions to show which installations are not linked to any environment in the\nspecified directory:\n\n.. code-block:: bash\n\n   $ pyenv versions --bare\n   3.6.10\n   3.7.5\n   3.7.9\n   3.8.6\n   3.9.1\n   pypy3.6-7.3.0\n   pypy3.6-7.3.1\n\n   $ comm -3 \u003c(pyenv users --raw ~ | cut -d: -f1 | uniq) \u003c(pyenv versions --bare) | tr -d \"[:blank:]\"\n   3.6.10\n   3.7.5\n   3.9.1\n   pypy3.6-7.3.0\n\n\nDisclaimer\n----------\n\nThe plugin doesn't maintain a list of environments; it generates the list each\nrun by performing a brute force scan of the directory for symlinks named\n`python`. This does mean it's not blazingly fast, but its simplicity provides\nstate-free reliability, and in practice ``find`` only takes a few seconds.\n\nAlso, it could really use more testing; so far I've been using it on Fedora 33\nwith no issues. Tested with ``bash v5.0.17(1)`` and ``find v4.7.0``.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyenv%2Fpyenv-users","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyenv%2Fpyenv-users","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyenv%2Fpyenv-users/lists"}