pyenv-win-master
立即下载
资源介绍:
pyenv-win-master
# pyenv for Windows
[pyenv][1] is an amazing tool used to manage multiple versions of python in your machine. We have ported it to Windows. We need your thoughts to improve this library and your feedback helps to grow the project.
For existing python users, we support [installation via pip](#installation).
Contributors and Interested people can join us on @[Slack](https://join.slack.com/t/pyenv/shared_invite/zt-f9ydwgyt-Fp8tehxqeCQi5mi77RxpGw). Your help keeps us motivated!
[![pytest](https://github.com/pyenv-win/pyenv-win/actions/workflows/pytest.yml/badge.svg)](https://github.com/pyenv-win/pyenv-win/actions/workflows/pytest.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![GitHub issues open](https://img.shields.io/github/issues/pyenv-win/pyenv-win.svg?)](https://github.com/pyenv-win/pyenv-win/issues)
[![Downloads](https://pepy.tech/badge/pyenv-win)](https://pepy.tech/project/pyenv-win)
[![Rate this package](https://badges.openbase.com/python/rating/pyenv-win.svg?token=hjylt9qszl1DzDMCXNqMQZ6ijtlNCYzG3dKZNF+hgk4=)](https://openbase.com/python/pyenv-win?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge)
- [Introduction](#introduction)
- [pyenv](#pyenv)
- [pyenv-win commands](#pyenv-win-commands)
- [Installation](#installation)
- [Validate installation](#validate-installation)
- [Usage](#usage)
- [How to update pyenv](#how-to-update-pyenv)
- [Announcements](#announcements)
- [FAQ](#faq)
- [Changelog](#changelog)
- [How to contribute](#how-to-contribute)
- [Bug Tracker and Support](#bug-tracker-and-support)
- [License and Copyright](#license-and-copyright)
- [Author and Thanks](#author-and-thanks)
## Introduction
[pyenv][1] for python is a great tool but, like [rbenv][2] for ruby developers, it doesn't directly support Windows. After a bit of research and feedback from python developers, I discovered they wanted a similar feature for Windows systems.
This project was forked from [rbenv-win][3] and modified for [pyenv][1]. It is now fairly mature, thanks to help from many different contributors.
## pyenv
[pyenv][1] is a simple python version management tool. It lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.
## Quick start
1. Install pyenv-win in PowerShell.
```pwsh
Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"
```
2. Reopen PowerShell
3. Run `pyenv --version` to check if the installation was successful.
4. Run `pyenv install -l` to check a list of Python versions supported by pyenv-win
5. Run `pyenv install ` to install the supported version
6. Run `pyenv global ` to set a Python version as the global version
7. Check which Python version you are using and its path
```plaintext
> pyenv version
(set by \path\to\.pyenv\pyenv-win\.python-version)
```
8. Check that Python is working
```plaintext
> python -c "import sys; print(sys.executable)"
\path\to\.pyenv\pyenv-win\versions\\python.exe
```
## pyenv-win commands
```yml
commands List all available pyenv commands
local Set or show the local application-specific Python version
latest Print the latest installed or known version with the given prefix
global Set or show the global Python version
shell Set or show the shell-specific Python version
install Install 1 or more versions of Python
uninstall Uninstall 1 or more versions of Python
update Update the cached version DB
rehash Rehash pyenv shims (run this after switching Python versions)
vname Show the current Python version
version Show the current Python version and its origin
version-name Show the current Python version
versions List all Python versions available to pyenv
exec Runs an executable by first preparing PATH so that the selected
Python version's `bin' directory is at the front
which Display the full path to an executable
whence List all Python versions that contain the given executable
```
## Installation
Currently we support following ways, choose any of your comfort:
- [PowerShell](docs/installation.md#powershell) - easiest way
- [Git Commands](docs/installation.md#git-commands) - default way + adding manual settings
- [Pyenv-win zip](docs/installation.md#pyenv-win-zip) - manual installation
- [Python pip](docs/installation.md#python-pip) - for existing users
- [Chocolatey](docs/installation.md#chocolatey)
- [How to use 32-train](docs/installation.md#how-to-use-32-train)
- [check announcements](#announcements)
Please see the [Installation](./docs/installation.md) page for more details.
## Validate installation
1. Reopen the command prompt and run `pyenv --version`
2. Now type `pyenv` to view it's usage
If you are getting "**command not found**" error, check the below note and [manually check the settings](#manually-check-the-settings)
For Visual Studio Code or another IDE with a built in terminal, restart it and check again
***
### Manually check the settings
Ensure all environment variables are properly set with high priority via the GUI:
```plaintext
This PC
→ Properties
→ Advanced system settings
→ Advanced → Environment Variables...
→ PATH
```
**NOTE:** If you are running Windows 10 1905 or newer, you might need to disable the built-in Python launcher via Start > "Manage App Execution Aliases" and turning off the "App Installer" aliases for Python
## Usage
- To view a list of python versions supported by pyenv windows: `pyenv install -l`
- To filter the list: `pyenv install -l | findstr 3.8`
- To install a python version: `pyenv install 3.5.2`
- _Note: An install wizard may pop up for some non-silent installs. You'll need to click through the wizard during installation. There's no need to change any options in it. or you can use -q for quiet installation_
- You can also install multiple versions in one command too: `pyenv install 2.4.3 3.6.8`
- To set a python version as the global version: `pyenv global 3.5.2`
- This is the version of python that will be used by default if a local version (see below) isn't set.
- _Note: The version must first be installed._
- To set a python version as the local version: `pyenv local 3.5.2`.
- The version given will be used whenever `python` is called from within this folder. This is different than a virtual env, which needs to be explicitly activated.
- _Note: The version must first be installed._
- After (un)installing any libraries using pip or modifying the files in a version's folder, you must run `pyenv rehash` to update pyenv with new shims for the python and libraries' executables.
- _Note: This must be run outside of the `.pyenv` folder._
- To uninstall a python version: `pyenv uninstall 3.5.2`
- To view which python you are using and its path: `pyenv version`
- To view all the python versions installed on this system: `pyenv versions`
- Update the list of discoverable Python versions using: `pyenv update` command for pyenv-win `2.64.x` and `2.32.x` versions
## How to update pyenv
- If installed via pip
- Add your pyenv-win installation path to `easy_install.pth` file located in site-packages. This should make pip recognise pyenv-win as installed.
- Get updates via pip `pip install --upgrade pyenv-win`
- If installed via Git
- Go to `%USERPROFILE%\.pyenv\pyenv-win` (which is your installed path) and run `git pull`
- If installed via zip
- Download the latest zip and extract it
- Go to `%USERPROFILE%\.pyenv\pyenv-win` and replace the folders `libexec` and `bin` with the new ones you just downloaded
- If installed via the insta
资源文件列表:
pyenv-win-master.zip 大约有109个文件