pyenv

debian9安装pyenv管理python版本

我与影子孤独终老i 提交于 2019-12-05 06:20:58
debian9的sid源可以安装最新版python(3.7),但是最近发现多版本情况下,安装python3-pip有问题,具体表现在无法确保多版本并存,于是想到了之前了解的virtualenv的衍生物--pyenv。废话不说,直接上教程,以作记录! 一、安装依赖 sudo apt install make build-essential libssl-dev zlib1g-dev libbz2-dev \ libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ xz-utils tk-dev libffi-dev liblzma-dev python-openssl git 二、使用脚本安装 curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash 三、按照要求,添加环境 vim .bashrc 添加以下行 export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" 然后 source .bashrc 安装完毕 卸载直接删除[.pyenv

Ubuntu 18.04安装 pyenv、pyenv-virtualenv、virtualenv、Numpy、SciPy、Pillow、Matplotlib

你说的曾经没有我的故事 提交于 2019-12-05 02:35:17
1、目前Python版本管理工具有很多,pyenv是比较好用的一款,安装如下: 输入: git clone https://github.com/pyenv/pyenv.git ~/.pyenv echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc source ~/.bashrc 没有问题的话,即安装成功。安装过程中出现缺依赖缺包提示,缺什么包安什么包。 2、安装pyenv的插件pyenv-virtualenv来管理虚拟环境,安装完成后设置一下, 3、安装virtualenv到系统环境 和 pip搭配使用 4、安装Numpy Numpy 是Python中用于科学计算的核心库,它提供了高性能的多维数组对象,以及相关工具,安装如图, 5、安装SciPy,它基于Numpy,提供了大量的计算和操作数组的函数, 这些函数对于不同类型的科学和工程计算非常有用,安装如图, 6、安装Pillow,它源自PIL(Python Imaging

ubuntu安装pyenv

穿精又带淫゛_ 提交于 2019-12-05 02:26:22
安装依赖包 bash {.line-numbers} sudo apt-get update sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev sudo apt-get install libssl-dev openssl sudo apt-get install libffi-dev 安装pyenv bash {.line-numbers} git clone git://github.com/yyuu/pyenv.git ~/.pyenv echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc echo 'eval "$(pyenv init -)"' >> ~/.bashrc exec $SHELL -l 安装 python3.7.0

How to implement locking in a multi process system?

折月煮酒 提交于 2019-12-04 16:51:34
We are running lots of jenkins projects in parallel. We are using python, and we have chosen to manage the virtual environments with pyenv. Unfortunately, pyenv has a well-known race condition . To work around the problem, I would like to implement locking at the process level. What I want to do is: lock some resource (a file?) do my pyenv stuff unlock the resource My scripts are written in bash. How can I implement resource locking / unlocking in bash? 2ps So your friend in the unix world when wanting a cross-process lock is a command called flock . It is implemented as an atomic operation at

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

江枫思渺然 提交于 2019-12-04 12:15:53
问题 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

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

送分小仙女□ 提交于 2019-12-04 08:55:27
问题 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

mac安装python本版管理工具pyenv

房东的猫 提交于 2019-12-04 08:51:25
安装 brew install pyenv 查看当前版本 pyenv install --list 安装指定版本 pyenv install -v 3.7.4 Pyenv 的 versions 选项: pyenv versions --help 查看 pyenv 下都安装了哪些具体的版本 pyenv versions 们可以使用 global 选项来指定我们想要 python 版本 pyenv global 3.7.4 /*--> */ /*--> */ 来源: https://www.cnblogs.com/pikachuworld/p/11851118.html

Linux 下的 Python 多版本管理(pyenv)

浪子不回头ぞ 提交于 2019-12-04 06:10:40
#简介 提到 Python 环境管理,更多人可能会首先想到 virtualenv。但与用于创建独立包环境的 virtualenv 不同,pyenv 的作用仅限于维护不同版本的 Python。它的使用不依赖于 Python,是一个简单、独立的纯 shell 脚本工具。pyenv 也以 pyenv-virtualenv 插件的形式支持 virtualenv,强烈建议使用。安装后比较方便的是可以在你 cd 到项目目录时自动切换相应的虚拟环境,而不用老是 source . <br /> ###需求 ------------ 出于种种原因,很多人的电脑上会同时安装很多个版本的 Python,比如会有 2.7 + 3.4。一般在 windows 下我们都可以通过使用绝对路径的方式来绕过系统对 PATH 环境变量的查询;在 Linux 下除了这种方式外,还可以在脚本文件开头显示指定需要使用的解释器,就像这样:`#!/usr/bin/env python2.7` 或 `#!usr/bin/env python3.4`。一旦特定版本的解释器被打开后,就不用再担心 PATH 的问题了。 就是有点麻烦。所以为了能让用户随心所欲地使用不同版本的诸如 python、pip、django-admin.py 这样的命令,本篇的主题,pyenv 就被开发出来了。pyenv 在安装和配置完毕后可以实现:一键(命令

pytest running with another version of python

冷暖自知 提交于 2019-12-04 05:44:13
I've installed pyenv and have different versions of python installed with it: $ pyenv versions system 2.7.1 3.2.5 3.5.0 3.5.1 * 3.5.2 I use the following command to switch to python 3.5.2 : pyenv shell 3.5.2 And when I check the python version this is what I get: $ python --version Python 3.5.2 But when I run pytest , it still runs under python 2.7.6 : pytest -v ==================================================================== test session starts ==================================================================== platform linux2 -- Python 2.7.6, pytest-3.0.3, py-1.4.31, pluggy-0.4.0 --

pyenv: pip: command not found

≯℡__Kan透↙ 提交于 2019-12-04 02:54:39
I'm trying to get Python 2.7 to play nicely with pyenv and virtualenv on OSX El Capitan. I've installed pyenv with Homebrew, then Python 2.7.11 with pyenv install 2.7.11 . This describes the setup: $ which python /usr/local/bin/python $ which virtualenv /usr/local/bin/virtualenv $ head -1 /usr/local/bin/virtualenv #!/usr/local/bin/python $ which pip /Users/username/bin/pip $ head -1 /Users/robinedwards/bin/pip #!/usr/local/bin/python $ pyenv install --list | grep 2.7.11 2.7.11 .bashrc contains lines: export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init -)"