Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

pyenv for Windows. pyenv 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.

License

NotificationsYou must be signed in to change notification settings

pyenv-win/pyenv-win

Repository files navigation

pyenv 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 supportinstallation via pip.

Contributors and Interested people can join us on @Slack. Your help keeps us motivated!

pytestLicense: MITGitHub issues openDownloads

Introduction

pyenv for python is a great tool but, likerbenv 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 fromrbenv-win and modified forpyenv. It is now fairly mature, thanks to help from many different contributors.

pyenv

pyenv 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.

    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. Runpyenv --version to check if the installation was successful.

  4. Runpyenv install -l to check a list of Python versions supported by pyenv-win

  5. Runpyenv install <version> to install the supported version

  6. Runpyenv global <version> to set a Python version as the global version

  7. Check which Python version you are using and its path

    > pyenv version<version> (set by \path\to\.pyenv\pyenv-win\.python-version)
  8. Check that Python is working

    > python -c "import sys; print(sys.executable)"\path\to\.pyenv\pyenv-win\versions\<version>\python.exe

pyenv-win commands

commands     List all available pyenv commandslocal        Set or show the local application-specific Python versionlatest       Print the latest installed or known version with the given prefixglobal       Set or show the global Python versionshell        Set or show the shell-specific Python versioninstall      Install 1 or more versions of Pythonuninstall    Uninstall 1 or more versions of Pythonupdate       Update the cached version DBrehash       Rehash pyenv shims (run this after switching Python versions)vname        Show the current Python versionversion      Show the current Python version and its originversion-name Show the current Python versionversions     List all Python versions available to pyenvexec         Runs an executable by first preparing PATH so that the selectedPython version's `bin' directory is at the frontwhich        Display the full path to an executablewhence       List all Python versions that contain the given executable

Installation

Currently we support following ways, choose any of your comfort:

Please see theInstallation page for more details.

Validate installation

  1. Reopen the command prompt and runpyenv --version
  2. Now typepyenv to view it's usage

If you are getting "command not found" error, check the below note andmanually check the settings

For Visual Studio Code or another IDE with a built in terminal, restart it and check again


Manually check the settings

The environment variables to be set:

C:\Users\<replace with your actual username>\.pyenv\pyenv-win\binC:\Users\<replace with your actual username>\.pyenv\pyenv-win\shims

Ensure all environment variables are properly set with high priority via the GUI:

This PC   → Properties      → Advanced system settings         → Advanced → System 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 wheneverpython 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 runpyenv 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-win2.64.x and2.32.x versions

How to update pyenv

  • If installed via pip
    • Add your pyenv-win installation path toeasy_install.pth file located in site-packages. This should make pip recognise pyenv-win as installed.
    • Get updates via pippip install --upgrade pyenv-win
  • If installed via Git
    • Go to%USERPROFILE%\.pyenv\pyenv-win (which is your installed path) and rungit pull
  • If installed via zip
    • Download the latest zip and extract it
    • Go to%USERPROFILE%\.pyenv\pyenv-win and replace the folderslibexec andbin with the new ones you just downloaded
  • If installed via the installer
    • Run the following in a Powershell terminal:&"${env:PYENV_HOME}\install-pyenv-win.ps1"

Announcements

To keep in sync withpyenv linux/mac, pyenv-win now installs 64bit versions by default. To support compatibility with older versions of pyenv-win, we maintain a 32bit train (branch) as a separate release.

Both releases can install 64bit and 32bit python versions; the difference is in version names, for example:

  • 64bit-train (master), i.e. pyenv version2.64.x
> pyenv install -l | findstr 3.8....3.8.0-win323.8.03.8.1rc1-win323.8.1rc13.8.1-win323.8.13.8.2-win323.8.23.9.0-win323.9.0....
  • 32bit-train, i.e. pyenv version2.32.x
> pyenv install -l | findstr 3.8....3.8.03.8.0-amd643.8.1rc13.8.1rc1-amd643.8.13.8.1-amd643.8.23.8.2-amd64....

Support for Python versions below 2.4 have been dropped since their installers don't install "cleanly" like versions from 2.4 onward and they're predominantly out of use/support in most environments now.

FAQ

Please see theFAQ page.

Changelog

Please see theChangelog page.

How to contribute

  • Fork the project & clone locally.
  • Create an upstream remote and sync your local copy before you branch.
  • Branch for each separate piece of work. It's good practice to write test cases.
  • Do the work, write good commit messages, and read the CONTRIBUTING file if there is one.
  • Test the changes by runningtests\bat_files\test_install.bat andtests\bat_files\test_uninstall.bat
  • Push to your origin repository.
  • Create a new Pull Request in GitHub.

Bug Tracker and Support

  • Please report any suggestions, bug reports, or annoyances with pyenv-win through theGitHub bug tracker.

License and Copyright

  • pyenv-win is licensed underMIT2019

    License: MIT

Author and Thanks

pyenv-win was developed byKiran Kumar Kotari andContributorsThanks for all Contributors and Supports for patience for the latest major release.

About

pyenv for Windows. pyenv 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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp