Mac OSX Python Multi-version management tool: Pyenv and virtualenv Build

Source: Internet
Author: User
Tags install brew openssl lib virtualenv

This blog post is just a brief description of how to install a conceptual question.

Environment: 10.13.1+shell

1. Install Brew

Website address: https://brew.sh/

/usr/bin/ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. Use Brew to install pyenv

Method 1

$ Brew Update

$ Brew Install pyenv

Method 2

Install via GitHub



I use method one to install

After installation, put F which pyenv >/dev/null; Then eval "$ (pyenv init-)"; Fi Append to ~/.bash_profile

Install the required version:

Pyenv Install 3.6.3

Error during issue:

error:the Python SSL extension was not compiled. Missing The OpenSSL lib?

WORKAROUND: Append export path= "/usr/local/opt/openssl/bin: $PATH" to ~/.bash_profile

Perform

SOURCE ~/.bash_profile

Ldflags= "-l$ (Brew--prefix OpenSSL)/lib" cppflags= "-i$ (Brew--prefix OpenSSL)/include" Pyenv Install 3.6.3

After that, the installation will be successful.

Pyenv install 3.6.3 version of Python

Installing virtualenv

Brew Install Pyenv-virtualenv

Create an environment using the PYENV virtualenv version number Environment name command

Error message:

Failed to activate Virtualenv.


Perhaps Pyenv-virtualenv has no been loaded into your shell properly.

Please restart the current shell and try again.


Append environment variables

If which pyenv-virtualenv-init >/dev/null; Then eval "$ (pyenv virtualenv-init-)"; Fi

SOURCE ~/.bash_profile


Pyenv Local 3.6.3 env3.6.3

Since this basic feature has been installed complete



This article is from the "Fight Together" blog, please make sure to keep this source http://zwltc.blog.51cto.com/6019176/1983931

Mac OSX Python Multi-version management tool: Pyenv and virtualenv Build

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.