pyenv

pyenv环境部署

匿名 (未验证) 提交于 2019-12-03 00:09:02
pyenv环境部署 pyenv安装使用git [root@kang ~]# yum install git -y python安装依赖 yum -y install gcc make patch gdbm-devel openssl-devel sqlite-devel readline-devel zlib-devel bzip2-devel 创建用户python useradd python 使用python用户登录 curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash 在pythonet用户的.~/.bashrc中追加: export PATH="/home/python/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" [python@kang ~]$ source .bashrc pyenv install 3.5.3 #按装指定版本 pip通用配置: mkdir ~/.pip vim ~/.pip/pip.conf [global] index-url=https://mirrors.aliyun.com/pypi/simple

mac上多版本python环境+配置pycharm

匿名 (未验证) 提交于 2019-12-02 22:51:30
0x00:写在前面 emmm mac更新到最新版本10.15以后anaconda就显示不支持当前的系统版本 只能换pyenv来管理python 0x01:开始安装 首先安装brew(可以终端下brew确定一下有没有安装) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 然后安装pyenv brew install pyenv 在.bash_profile中添加,不添加则切换python版本会有问题 export PYENV_ROOT=/usr/local/var/pyenv if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi 更新一下 source .bash_profile 然后开始安装python环境(可以先pyenv install --list查看一下支持的python版本) 既然是配置环境嘛 那就py2和py3共存就好啦,可以来回切换 pyenv install 3.7.0 pyenv install 2.7.15有点慢,因为是国外镜像,可以带代理 如果安装过程出现错误,比如如下 CFLAGS="-I$(xcrun --show-sdk-path)/usr

python 虚拟环境 pyenv

匿名 (未验证) 提交于 2019-12-02 22:51:30
一、pyenv简介 pyenv 主要用来管理 Python 的版本,比如一个项目需要 Python 2.x ,一个项目需要 Python 3.x 。 pyenv 通过系统修改环境变量来实现 Python 不同版本的切换。 pyenv 它并没有使用将不同的 PATH植入不同的shell这种高耦合的工作方式,而是简单地在PATH 的最前面插入了一个垫片路径(shims):~/.pyenv/shims:/usr/local/bin:/usr/bin:/bin。所有对 Python 可执行文件的查找都会首先被这个 shims 路径截获,从而使后方的系统路径失效。 二、安装pyenv 1、安装pyenv依赖包 yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel libpcap-devel xz-devel yum -y install git (用于从git中下载pyenv) 2.安装pyenv 从git上面克隆下pyenv,安装完毕 git clone https://github.com/pyenv/pyenv.git 3.配置pyenv环境变量 echo 'export PYENV_ROOT="$HOME

How can I install zlib on Mac OS X Mojave (10.14)?

风格不统一 提交于 2019-12-02 22:40:26
I recently upgraded from Sierra to Mojave. After that I tried to use pyenv install 3.5.6 . This uses homebrew in the background to try to install python, which fails with zipimport.ZipImportError: can't decompress data; zlib not available . The same command worked before the upgrade. This question has been asked before and the generally accepted solution is to install xcode command line tools using this command: xcode-select --install . I have both xcode 10 and the command line tools installed but zlib is still unavailable. I tried installing zlib using homebrew but that didn't work either.

pyenv zlib error on MacOS:

孤街醉人 提交于 2019-12-02 18:50:40
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 (OS X 10.13.4 using python-build 20160602) Inspect or clean up the working tree at /var/folders/d0

Cannot switch Python with pyenv

孤者浪人 提交于 2019-12-02 17:39:57
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.0 Soma-Suzuki:~ Soma$ pyenv global 3.5.0 Soma-Suzuki:~ Soma$ pyenv versions system 2.7.10 * 3.5.0 (set

What is the difference between pyenv, virtualenv, anaconda?

╄→гoц情女王★ 提交于 2019-12-02 13:52:06
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. Now I am getting confused with the purpose of these two pyenv and virtualenv. worse inside pyenv there

pyenv虚拟环境管理

依然范特西╮ 提交于 2019-12-02 12:11:51
一. pyenv 简单介绍 在日常运维中, 经常遇到这样的情况: 系统自带的 Python 是 2.x,而业务部署需要 Python 3.x 环境, 此时需要在系统中安装多个 Python 版本,但又不能影响系统自带的 Python 版本,即需要实现 Python 的多版本环境共存, pyenv 就是这样一个 Python 版本管理器, 可以同时管理多个 python 版本共存! 简单的说,pyenv 可以根据需求使用户在系统里安装和管理多个 Python 版本: 配置当前用户的 python 的版本; 配置当前 shell 的 python 版本; 配置某个项目(目录及子目录)的 python 版本; 配置多个虚拟环境. 由于 python 的各种优点,当前学习及使用 python 的人越来越多, 学习 python有一个不容忽视的问题就是 python 的版本问题! 到现在为止,python 的版本有很多,但是问题在于 python2 与 python3 的区别。python3 的对一些模块进行了改变,导致了 python2 写的代码有的不被 python3 兼容,从而导致程序运行报错。因此,在学习和工作中使用 python 的时候,最好是安装一个 pyenv 管理器, 多安装几个 python 版本进行管理, 然后再针对不同项目安装各自项目的 python 虚拟环境,

pyenv prints module in terminal when executing said module

心不动则不痛 提交于 2019-12-02 09:27:39
I've moved over to using pyenv when running python. The problem though is when I execute a module and that module imports other module pyenv will often print a huge chunk of what to me is gibberish. For example, alias py37="pyenv local 3.7.3 && python" Admins-MacBook-Pro-4:general kylefoley$ py37 Python 3.7.3 (default, Oct 16 2019, 03:01:07) [Clang 10.0.1 (clang-1001.0.46.4)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import keyboard bool b'B' <classmethod object at 0x10a7317f0> <function ivar.bool at 0x10bf8b8c8> char b'c' <classmethod object at

jupyter、pyenv、virtualenv、virtualenvwrapper简要区别

你。 提交于 2019-12-01 18:49:30
一、区别 1.jupyter 对接ipython,作为一个web端的notebook,便于python工作。 2.pyenv 在创建一个新的python版本时,完全拷贝一个现成的python环境。新的python版本,可作为global 3.virtualenv 在创建一个新的python版本时,他生成一套软链到现有的python环境,即执行环境和版本不变,也可以制定一个python解释器让他来virtual,但是他的site-packages是独立的。 针对一个应用,建立一个独立的python运行环境。 4.pyenv-virtualenv 创建一个新的python版本时,拷贝了一份执行环境,放到当前版本的/envs/venv下面。并由pyenv activate venv和pyenv deactivate 5.virtualenvwrapper 是对virtualenv的扩展。用来管理全部的虚拟环境。mkvirtualenv创建新的虚拟环境, cpvirtualenv 拷贝虚拟环境,rmvirtualenv删除虚拟环境, workon 切换不同的虚拟环境,不同的project 二、pyenv的安装使用 只在linux和mac上,windows不行 参考文档 1.: https://www.douban.com/note/616389950/ 2.Python版本管理