zoukankan      html  css  js  c++  java
  • Python开发环境之pyenv环境搭建

      首先到Github上下载Pyenv相应的一键安装脚本,

      安装完毕,设置环境变量,设置环境变量,可以添加到个人家目录的.bashrc或.bash_profile及系统的全局的/etc/profile,

      # Load pyenv automatically by adding

      # the following to ~/.bash_profile:

      export PATH="/home/lavenliu/.pyenv/bin:$PATH"

      eval "$(pyenv init -)"

      eval "$(pyenv virtualenv-init -)"

      设置完毕之后,可以在命令行进行验证,

      [lavenliu@VM_113_230_centos ~]$ . ~/.bash_profile

      [lavenliu@VM_113_230_centos ~]$ pyenv

      pyenv 20160726

      Usage: pyenv []

      Some useful pyenv commands are:

      commands List all available pyenv commands

      local Set or show the local application-specific Python version

      global Set or show the global Python version

      shell Set or show the shell-specific Python version

      install Install a Python version using python-build

      uninstall Uninstall a specific Python version

      rehash Rehash pyenv shims (run this after installing executables)

      version Show the current Python version and its origin

      versions List all Python versions available to pyenv

      which Display the full path to an executable

      whence List all Python versions that contain the given executable

      See `pyenv help ' for information on a specific command.

      For full documentation, see: https://github.com/yyuu/pyenv#readme

      以上都没有问题。比如,安装一个3.5.2的版本Python,

      pyenv install 3.5.2

      如果下载速度慢的话,可以事先下载之,放到~/.pyenv/cache目录即可。修改~/.pyenv/plugins/python-build/share/python-build/3.5.2文件,

      cat ~/.pyenv/plugins/python-build/share/python-build/3.5.2

      #require_gcc

      install_package "openssl-1.0.2g" "https://www.openssl.org/source/openssl-1.0.2g.tar.gz#b784b1b3907ce39abf4098702dade6365522a253ad1552e267a9a0e89594aa33" mac_openssl --if has_broken_mac_openssl

      install_package "readline-6.3" "http://ftpmirror.gnu.org/readline/readline-6.3.tar.gz#56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43" standard --if has_broken_mac_readline

      if has_tar_xz_support; then

      install_package "Python-3.5.2" "~/.pyenv/cache/Python-3.5.2.tar.gz" ldflags_dirs standard verify_py35 ensurepip

      else

      install_package "Python-3.5.2" "~/.pyenv/cache/Python-3.5.2.tar.gz" ldflags_dirs standard verify_py35 ensurepip

      fi无锡人流多少钱 http://wapyyk.39.net/wx/zonghe/fc96e.html

      由于没有~/.pyenv/cache目录,进行手工创建,

      $ mkdir ~/.pyenv/cache

      如果使用手工安装,则需要安装一些依赖,

      # yum install -y gcc make patch gdbm-devel openssl-devel sqlite-devel zlib-devel bzip2-devel readline-devel

      需要事先准备好Python-3.5.2.tar.gz的安装包,放到~/.pyenv/cache目录下。然后,在命令行直接使用pyenv install 3.5.2即可,

      $ pyenv install 3.5.2

      安装完毕,使用version命令进行查看,

      pyenv version

      3.5.2 (set by /home/lavenliu/.python-version)

      至此,就安装完毕了。

  • 相关阅读:
    阿里测试工程师教你自动化测试如何准备测试数据
    同一个tomcat下部署多个springboot项目时,springboot项目无法正常启动的问题
    ant desgin pro 跨页面传参
    富兰克林的人生信条
    node 一拉管理工具 yarn安装(npm的替代品)
    python pip 安装包下载过慢的解决方法 socket.timeout: The read operation timed out
    springBoot 文件下载
    Excel无法打开文件xxx.xlsx,因为文件格式或文件扩展名无效。请确定文件未损坏,并且文件扩展名与文件的格式匹配
    MYSQL like 模糊查询 分字查询
    人人译视界-给视频添加srt字幕
  • 原文地址:https://www.cnblogs.com/djw12333/p/10993306.html
Copyright © 2011-2022 走看看