Главная страница » Как установить pyenv windows 10 pro 64

Как установить pyenv windows 10 pro 64

  • автор:

pyenv-win

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.

Installation

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

    — easiest way — default way + adding manual settings — manual installation — for existing users

Hurray! When you are done here are steps to Validate installation

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

PowerShell

The easiest way to install pyenv-win is to run the following installation command in a PowerShell terminal:

If you are getting any UnauthorizedAccess error as below then start Windows PowerShell with the “Run as administrator” option and run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine , now re-run the above installation command.

For more information on ‘digitally signed’ or ‘Security warning’ you can refer to following issue #332

Installation is complete!

Git Commands

The default way to install pyenv-win, it needs git commands you need to install git/git-bash for windows

If you are using PowerShell or Git Bash use $HOME instead of %USERPROFILE%

git clone using command prompt git clone https://github.com/pyenv-win/pyenv-win.git «%USERPROFILE%\.pyenv»

Note: Don’t forget the check above link, it contains final steps to complete.

Installation is complete!

Pyenv-win zip

Manual installation steps for pyenv-win

If you are using PowerShell or Git Bash use $HOME instead of %USERPROFILE%

Create a .pyenv directory using command prompt mkdir %USERPROFILE%/.pyenv if not exist

Extract and move files to %USERPROFILE%\.pyenv\

Ensure there is a bin folder under %USERPROFILE%\.pyenv\pyenv-win

Note: Don’t forget the check above link, it contains final steps to complete.

Installation is complete!

Python pip

For existing python users

Command prompt

pip install pyenv-win —target %USERPROFILE%\\.pyenv

If you run into an error with the above command use the folllowing instead (#303):

pip install pyenv-win —target %USERPROFILE%\\.pyenv —no-user —upgrade

PowerShell or Git Bash

Use the same command as above, but replace %USERPROFILE% with $HOME .

Final steps

Installation should then be complete!

Chocolatey

This needs choco commands to install, installation link

Chocolatey command choco install pyenv-win

Installation is complete!

Add System Settings

It’s a easy way to use PowerShell here

Adding PYENV, PYENV_HOME and PYENV_ROOT to your Environment Variables

Now adding the following paths to your USER PATH variable in order to access the pyenv command

Installing Pythons with PyEnv

Using pyenv to manage Python 2 and Python 3 environments

Python is extremely popular these days for a variety domains. Python is popular for web programming, with famous web frameworks like Flask, Tornado, Django.

For systems and applications automation, Python is popular general scripting language, for popular platforms like Fabric for deployments, and beyond deployment adding change configuration, Salt Stack and Ansible. Python is also popular as a build tool, such as the node-gyp tool used for many libraries and tools on the Node.js platform.

The Problem and Solution

But there comes the question, which Python? There’s two different Python languages, Python 2 and Python 3. On some systems, the command python can be python 2, and others it is python 3. And commands python2 and python3 may or may not be supported.

Within each platform, Python 2 and Python 3, your application may or may not function correctly between different versions of Python. So how do we manage all of this?

Enter PyEnv, a simple python version manager.

With pyenv command, you can install multiple versions of Python 2 and Python 3, specify, which Python platform is default for the python command, as well as have python2 and python3 commands available.

The Installation

For pyenv you need a *nix environment, such as Linux and macOS. Unfortunately, Windows is not supported. Before installing PyEnv, you’ll need to install compilers, libraries, and headers, as PyEnv will download and compile Python from source.

I wrote a previous blog on how to get compilers:

Getting Compilers

To Code or Not to Code?

macOS installation

You can easily install PyEnv along with some required libraries using Homebrew:

Linux Libraries Prereq: Ubuntu and Debian

One you have the build tools installed, you need some libraries to install python:

Linux Libraries Prereq: CentOS (RHEL) and Fedora

Once have the build tools installed, you need some libraries to install python:

Linux installation

The Usage

PyEnv is install per user, where you can use these different ways:

  • global : default for when starting a shell for the current user
  • shell : updates the current session
  • local : use the local project version specified in a .python-version file. Python is set at the current directory level, useful for managing python per project.

Install and Default Python Versions

As an example, this installs current latest stable versions of Python 3 and Python 2, and then has defaults for Python 2 platform for python command.

Update Pip and Setuptools

It is good practice to update both Pip and Setuptools. For those unfamiliar with this, these are package installers, where pip is the most popular.

Setuptools uses the command line easy_install to install packages. There is no uninstall option. These packages can include Python bytecode, called egg packages, which makes packages not portable between operating systems.

Pip can both install and uninstall, and only includes source code packages, which means only scripts, no byte-code, so they are usable across different Linux distributions and operating systems.

Installing Python packages

Now that you have the desired Python version install, we can try out some packages. Packages that have command line tools can be made available to your current python version by running pyenv rehash .

VirtualEnv Integration

PyEnv includes a plug-in pyenv-virtualenv that includes integration with virtualenv . With this you can initialize and automatically switch into both your desired python version as well as a segregated environment for your python packages installed through pip.

Name already in use

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

pyenv for Windows

pyenv is a great tool. 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.

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

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

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.

Install pyenv-win in PowerShell.

Run pyenv —version to check if the installation was successful.

Run pyenv install -l to check a list of Python versions supported by pyenv-win

Run pyenv install <version> to install the supported version

Run pyenv global <version> to set a Python version as the global version

Check which Python version you are using and its path

Check that Python is working

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

    — easiest way — default way + adding manual settings — manual installation — for existing users

Please see the Installation page for more details.

  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

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:

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

  • 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
    • 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.
    • 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.
    • Note: This must be run outside of the .pyenv folder.

    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
      • Go to %USERPROFILE%\.pyenv\pyenv-win (which is your installed path) and run git pull
      • 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
      • Run the following in a Powershell terminal: &»$\install-pyenv-win.ps1″

      To keep in sync with pyenv 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 version 2.64.x
      • 32bit-train, i.e. pyenv version 2.32.x

      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.

      Please see the FAQ page.

      Please see the Changelog 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 running tests\bat_files\test_install.bat and tests\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 the GitHub bug tracker.

      License and Copyright

      pyenv-win is licensed under MIT 2019

      Author and Thanks

      pyenv-win was developed by Kiran Kumar Kotari and Contributors
      Thanks 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.

      pyenv-win 3.1.1

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

      Навигация

      Ссылки проекта

      Статистика

      • Звёзд:
      • Форков:
      • Open issues:
      • Open PRs:

      Метаданные

      Лицензия: MIT License

      Метки pyenv for windows, multiple versions of python

      Сопровождающие

      Классификаторы

      • Development Status
        • 5 — Production/Stable
        • Developers
        • OSI Approved :: MIT License
        • Microsoft :: Windows
        • Python :: 2.6
        • Python :: 2.7
        • Python :: 3.1
        • Python :: 3.2
        • Python :: 3.3
        • Python :: 3.4
        • Python :: 3.5
        • Python :: 3.6
        • Python :: 3.7
        • Python :: 3.8
        • Python :: 3.9
        • Python :: 3.10
        • Software Development :: Build Tools

        Описание проекта

        pyenv for Windows

        pyenv is a great tool. 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.

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

        Introduction

        pyenv for python is a great tool but, like rbenv 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 and modified for pyenv. 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.

        pyenv-win commands

        Installation

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

          — easiest way — default way + adding manual settings — manual installation — for existing users

        Hurray! When you are done here are steps to Validate

        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

        Power Shell

        The easiest way to install pyenv-win is to run the following installation command in a PowerShell terminal:

        If you are getting any UnauthorizedAccess error as below then start Windows PowerShell with the «Run as administrator» option and run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine , now re-run the above installation command.

        For more information on ‘digitally signed’ or ‘Security warning’ you can refer to following issue #332

        Installation is complete!

        Git Commands

        The default way to install pyenv-win, it needs git commands you need to install git/git-bash for windows

        If you are using PowerShell or Git Bash use $HOME instead of %USERPROFILE%

        git clone using command prompt git clone https://github.com/pyenv-win/pyenv-win.git «%USERPROFILE%\.pyenv»

        Note: Don’t forget the check above link, it contains final steps to complete.

        Installation is complete!

        Pyenv-win zip

        Manual installation steps for pyenv-win

        If you are using PowerShell or Git Bash use $HOME instead of %USERPROFILE%

        Create a .pyenv directory using command prompt mkdir %USERPROFILE%/.pyenv if not exist

        Extract and move files to %USERPROFILE%\.pyenv\

        Ensure there is a bin folder under %USERPROFILE%\.pyenv\pyenv-win

        Note: Don’t forget the check above link, it contains final steps to complete.

        Installation is complete!

        Python pip

        For existing python users

        If you are using PowerShell or Git Bash use $HOME instead of %USERPROFILE%

        installation command via command prompt
        pip install pyenv-win —target %USERPROFILE%\\.pyenv

        if you having an error on above command use the folllowing to resolve it. ref. link #303
        pip install pyenv-win —target %USERPROFILE%\\.pyenv —no-user —upgrade

        Note: Don’t forget the check above link, it contains final steps to complete.

        Installation is complete!

        Chocolatey

        This needs choco commands to install, installation link

        Chocolatey command choco install pyenv-win

        Installation is complete!

        Add System Settings

        It’s a easy way to use PowerShell here

        1. Adding PYENV, PYENV_HOME and PYENV_ROOT to your Environment Variables
        1. Now adding the following paths to your USER PATH variable in order to access the pyenv command

        Installation is done. Hurray!

        How to use 32-train

        Using Git

        1. For 32-train prerequisite is installing pyenv-win using Git
        2. Go to .pyenv dir command cd %USERPROFILE%\.pyenv
        3. run git checkout -b 32bit-train origin/32bit-train
        4. run pyenv —version and you should see 2.32.x

        Using pip

        run pip install pyenv-win==2.32.x —target %USERPROFILE%\.pyenv

        Using Zip

        Follow step 2 from Pyenv-win zip

        Validate

        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

        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 via the GUI:

        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
          • 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.
          • 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.
          • Note: This must be run outside of the .pyenv folder.

          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
            • Go to %USERPROFILE%\.pyenv\pyenv-win (which is your installed path) and run git pull
            • 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
            • Run the following in a Powershell terminal: &»$\install-pyenv-win.ps1″

            Announcements

            ==================
            To keep in sync with pyenv 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 version 2.64.x
            • 32bit-train, i.e. pyenv version 2.32.x

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

            Question: Does pyenv for windows support python2?

            • Answer: Yes, We support python2 from version 2.4+ until python.org officially removes it.
            • Versions below 2.4 use outdated Wise installers and have issues installing multiple patch versions, unlike Windows MSI and the new Python3 installers that support «extraction» installations.

            Question: Does pyenv for windows support python3?

            • Answer: Yes, we support python3 from version 3.0. We support it from 3.0 until python.org officially removes it.

            Question: I am getting the issue batch file cannot be found. while installing python, what should I do?

            • Answer: You can ignore it. It’s just calling pyenv rehash command before creating the bat file on some devices.

            Question: System is stuck while uninstalling a python version

            • Answer: Navigate to the location where you installed pyenv, open its ‘versions’ folder (usually %USERPROFILE%\.pyenv\pyenv-win\versions ), and delete the folder of the version you want removed.

            Question: I installed pyenv-win using pip. How can I uninstall it?

            • Answer: Follow the pip instructions in How to update pyenv and then run pip uninstall pyenv-win

            Question: pyenv-win is not recognised, but I have set the ENV PATH?

            • Answer: According to Windows, when adding a path under the User variable you need to logout and login again, in order to reflect any change. For the System variable it’s not required.

            Change Log

            New in 3.1.1

            • Fix #413: bug: pyenv install failing because the system cannot find the file specified ‘dark.exe’
            • Adding: python 3.8, 3.9 and 3.10 in classifiers

            New in 3.1

            • Fix #142: Prefer the local installer over the web based installer
            • Fix #401, #396, #383 and #360: Added the same level of support for local based installer as we have for web based installers in #410
              • Note: It is best to uninstall affected versions (3.9.11 and above) via Windows’ Add or remove Programs systems settings page before running the pyenv uninstall command for those versions.

              New in 3.0

              • Fix #311: Support many global and shell versions.
              • Fix #318: pyenv global and pyenv local no longer affect PYENV_VERSION, which only pyenv shell should affect.
              • The test suite emulates a 32 bit architecture environment.
              • The test suite now also runs tests using powershell and pwsh in addition to cmd .
              • pyenv shell now works like pyenv global and pyenv local in that, on 32-bit platforms, it adds -win32 to every supplied version if not explicitly added.

              New in 2.64.11

              • Fix #287: Prevent infinite recursion by removing the shims directory from the path.
              • Fix #259: Correctly handle spaces in pyenv path.
              • Fix #305: Fix exec preferring the last version listed in .python-version instead of the first.
                • Note: pyenv rehash must be called after upgrading. Expect the following error message if you don’t:

                New in 2.64.10

                • Check PATH in pyenv version to report other Python versions.

                New in 2.64.9

                • Feature #210: Support extended installer options
                • Fix #269: Migration from travis-ci to GitHub Actions
                • Fix exec shims for bat files.
                • Fix #193: PowerShell support for pyenv shell

                New in 2.64.8

                • Fix #198: PEP 514 support (64 bits only, excluding pypy).

                New in 2.64.7.4

                • Fix #256: Fix pyenv —version for username with space.

                New in 2.64.7.3

                • Fix #254: Fix exec with many local versions.

                New in 2.64.7.2

                • Fix #250: PATH is not impacted after a pyenv exec .

                New in 2.64.7.1

                • Fix #246: pyenv which and pyenv whence show help if no argument specified.
                • Fix exec problems after merge of #140.
                • Fix #247: no more incorrect file name in bash script if username contains a space.
                • Fix #243: hot fix for pyenv exec .

                New in 2.64.6.1

                • Use GitHub Actions to publish to PyPi.

                New in 2.64.5

                • Fix #239: Improve rehash error when no version installed.
                • Add pypy support.
                • Fix #140: Get rid of temp exec.bat to support multiple exec in parallel.

                New in 2.64.4

                • More python versions supported.
                • Fix #217: Add missing call to exec.bat .
                • Enhancement #225: Add tox support.
                • Fix #204: Support many local versions.
                • Enhancement #220: Rehash all installed versions with more shims.
                • Enhancement #221: Add pyenv global —unset .

                New in 2.64.3

                • Version naming conventions have now changed from using 64-bit suffixes when specifying a version to (un)install. Now all you need to use is the version number to install your platform’s specific bit version.
                  • *WARNING*: This change is backwards incompatible with v1.2.5 or less; if upgrading from that version, install 32bit-train which is backward compatible, or uninstall all versions of python prior to upgrading pyenv.
                  • Ex. pyenv install 2.7.17 will install as 64-bit on x64 and 32-bit on x86. (64-bit can still use 2.7.17-win32 to install the 32-bit version)
                  • pyenv global/local/shell also now recognize your platform and select the appropriate bit version. (64-bit users will need to specify [version]-win32 to use the 32-bit versions now)
                  • *WARNING*: This change is backwards incompatible with v1.2.5 or less; if upgrading from that version, install 32bit-train which is backward compatible, or uninstall all versions of python prior to upgrading pyenv.
                  • No install/uninstall records are written to the registry or Start Menu anymore (no «Programs and Features» records).
                  • When installing a patch version of python (ex. 3.6.1) installing another patch version (ex. 3.6.2) won’t reuse the same folder and overwrite the previously installed minor version. They’re now kept separate.
                  • Uninstalls are now a simple folder deletion. (Can be done manually by the user safely now or pyenv uninstall )
                  • When using —all on x64 computers you can use —32only or —64only to install only 32-bit or only 64-bit version s of python. (Does nothing on 32-bit computers, and better filters may be in the works later on)

                  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 running tests\bat_files\test_install.bat and tests\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 the GitHub bug tracker.

                  License and Copyright

                  pyenv-win is licensed under MIT 2019

                  Author and Thanks

                  pyenv-win was developed by Kiran Kumar Kotari and Contributors
                  Thanks for all Contributors and Supports for patience for the latest major release.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *