pyenv

Pyenv基础环境搭建

非 Y 不嫁゛ 提交于 2019-12-03 17:31:33
1.环境准备:rhel7.4最小化安装,关闭防火墙和selinux 2.配置阿里源: 3.安装git及依赖环境关系: 4.尽量不要使用root用户安装,新建用户“python” 5.安装脚本文件:    6.添加环境变量:   7.配置生效: 8.pyenv version(查看当前运行的python的版本),versions (pyenv可管理的python版本) 9.pyenv 三个重要的命令:   global ,shell,local   global:针对全局生效,(在生产环境慎用)   shell:只对当前终端生效(在生产环境基本不用)   local(针对当前目录---子目录拥有继承权限生效,常用),由于针对目录生效,多个python之间可能所依赖的软件不一样,这样的话不利于版本控制等,接下来推荐使用虚拟机环境+local命令: 10.进入虚拟环境(有“(virtual3.54)”的提示),查看当前pyenv管理的是虚拟“virtual3.54环境”,多个版本之间可以相互隔离,(且各个版本之间的软件依赖在不同的目录下) 11,在不同的目录下,生成虚拟环境3.6.3环境,使用"local"针对当前目录(子目录继承),实现版本隔离; 12,安装"ipython"交互式工具和jupyter工具,pip(python install packages

python基础入门及安装

淺唱寂寞╮ 提交于 2019-12-03 13:22:07
step1:安装pyenv 1.安装git 从最小系统安装,pyenv安装需要用git,所以先安装git:yum install git -y 2.python安装依赖包 yum -y install gcc make patch gdbm-devel openssl-devel sqlite-devel readline-devel zlib-devel bzip2-devel 3.创建用户python useradd python 4.使用python用户登录安装pyenv 执行 curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash 在python用户的 ~/.bash_profile中添加如下内容 export PATH="/home/python/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" 保存退出执行 source ~/.bash

What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Python 3.3 includes in its standard library the new package venv . What does it do, and how does it differ from all the other packages that seem to match the regex (py)?(v|virtual|pip)?env ? 回答 1 : PyPI packages not in the standard library: virtualenv is a very popular tool that creates isolated Python environments for Python libraries. If you're not familiar with this tool, I highly recommend learning it, as it is a very useful tool, and I'll be making comparisons to it for the rest of this answer. It works by installing a bunch of files in

pyenv: BUILD FAILED (Ubuntu 15.04 using python-build 20160509)

前提是你 提交于 2019-12-03 07:58:12
I have already installed the pyenv on my system, and the command pyenv install --list goes well. But when I download some Python versions using pyenv install 2.7.11 , it turns out as follows: Downloading Python-2.7.11.tgz... -> https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz error: failed to download Python-2.7.11.tar.gz BUILD FAILED (Ubuntu 15.04 using python-build 20160509) I didn't find any similar problem on the official Common build problems . Is it that pyenv didn't catch the new Ubuntu update? nicolas.f.g The command pyenv install -v 2.7.11 gave me a similar error. Installing

pyenv zlib error on MacOS:

空扰寡人 提交于 2019-12-03 06:20:50
问题 My goal I am trying to install Python 2.7.5 and 3.6.5 side-by-side on my MBP with with pyenv. pyenv Installation Following How can I use Homebrew to install both Python 2 and 3 on Mac? , I tried: $ pyenv install 3.6.5 Which erred with: python-build: use openssl from homebrew python-build: use readline from homebrew Downloading Python-3.6.5.tar.xz... -> https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz Installing Python-3.6.5... python-build: use readline from homebrew BUILD FAILED

Cannot switch Python with pyenv

被刻印的时光 ゝ 提交于 2019-12-03 03:55:08
问题 I would like to use pyenv to switch python2 and python3. I successfully downloaded python2 and python3 and pyenv with following codes. brew install pyenv brew install pyenv-virtualenv pyenv install 2.7.10 pyenv install 3.5.0 However, I cannot switch from python2 to python3.. Soma-Suzuki:~ Soma$ python --version Python 2.7.10 Soma-Suzuki:~ Soma$ pyenv global 2.7.10 Soma-Suzuki:~ Soma$ pyenv versions system * 2.7.10 (set by /Users/Soma/.pyenv/version) 3.5.0 Soma-Suzuki:~ Soma$ pyenv global 3.5

django开发环境部署(二)——python版本控制器pyenv

≯℡__Kan透↙ 提交于 2019-12-03 03:20:19
python版本控制器pyenv 之前的那篇是说明了django环境的site package完全独立出来了,但是使用的python解释器还是系统的,为了继续独立出来,甚至是达到ruby的rvm的自由切换解释器版本,那样不更好,日后线上升级python版本的时候直接再本地切换版本来运行当前代码测试岂不快哉,其实本篇已经不能算django开发环境了,是python开发环境部署 在上篇的基础上,继续进行解释器的版本管理器的安装,这里我使用的时pyenv,另外一个管理器是pythonbrew,还有一个pythonz,至于为什么选择pyenv,pythonbrew的GitHub主页上给出了解释如下 英文翻译水平太烂,只能搬原文 Deprecated This project is no longer under active development. You are encouraged to try out pyenv instead. 为什么选用pyenv Depend on Python itself . pyenv was made from pure shell scripts. There is no bootstrap problem of Python. Need to be loaded into your shell . Instead, pyenv's shim

Can't build python gevent on mac osx 10.10

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Synopsis: pip install gevent doesn't work. Digging down, I downloaded the gevent .tar.gz and ran the build manually: python setup.py build , got the same error: running build running build_py running build_ext building 'gevent.core' extension clang - DNDEBUG - g - fwrapv - O3 - Wall - Wstrict - prototypes - U__llvm__ - DLIBEV_EMBED = 1 - DEV_COMMON = - DEV_CLEANUP_ENABLE = 0 - DEV_EMBED_ENABLE = 0 - DEV_PERIODIC_ENABLE = 0 - Ibuild / temp . macosx - 10.10 - x86_64 - 2.7 / libev - Ilibev - I / Users / travisjohnson /. pyenv /

What is the difference between pyenv, virtualenv, anaconda?

好久不见. 提交于 2019-12-03 01:33:16
问题 I am a ruby programmer trying to learn python. I am pretty family with pyenv since it is like a copy and paste from rbenv. Pyenv helps allow to have more than one version of python in a system and also to isolate the python without touching sensitive part of system. I suppose every python installation come with pip package. What I still don't understand is, there are many good python libs out there that suggest to use this virtualenv and anaconda. I can even find virtualenv plugin for pyenv.

Arrow keys no longer work in Python shell after upgrading Mac OS to Sierra

倾然丶 夕夏残阳落幕 提交于 2019-12-03 01:23:00
I'm using zsh, iTerm2 (3.0.9), and pyenv (1.0.2) with pyenv global set to 3.5.2. In the Python shell, the up and down arrow keys used to work, to access the previous commands in the history. But now after upgrading to OSX 10.12, instead it shows control characters. For example up arrow displays: ^[[A I've tried installing readline as suggested in Seeing escape characters when pressing the arrow keys in python shell but that didn't help. I don't have the PYTHONSTARTUP variable but didn't used to before, and not sure how that interacts with pyenv. I solved it by installing python from homebrew: