推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
magicdu
V2EX  ›  Python

pip 和 pip3 同时安装 Django 的问题,建工程怎么指定 Python 版本啊

  •  1
     
  •   magicdu ·
    magicdu · Mar 9, 2017 · 3369 views
    This topic created in 3531 days ago, the information mentioned may be changed or developed.

    Python2.7 用 pip 安装了 Django,Python3.5 用 pip3 安装了 Django ,然后建工程

    django-admin startproject mysite
    
    

    比如我想同时建一个 2.7 的工程和 3.5 的工程。怎么指定 Python 版本啊。

    qweweretrt515
    qweweretrt515
    Mar 9, 2017
    1
    环境变量
    patrickstar
    patrickstar
    Mar 9, 2017
    2
    恐怕 pyvenv 或 virtualenv 才是解决之道哦
    shoaly
    shoaly
    Mar 9, 2017
    3
    virtualenv 应该是一个 prework 了.
    Kilerd
    Kilerd
    Mar 9, 2017
    4
    建议用 pyenv 来管理多个版本的 python 环境
    siteshen
    siteshen
    Mar 10, 2017
    5
    看了一下 django-admin 文件的源码, django-admin 文件在 python2 和 python3 下都能跑,所以能这么做:

    python2 $(which django-admin)
    python3 $(which django-admin)

    当然,还是维护多个项目,还是推荐使用 virtualenv 。
    zsz
    zsz
    Mar 11, 2017 via iPhone
    6
    看一下 https://www.u3v3.com/ar/1256
    点我头像,看简介,可以加群沟通,这样效率比较高
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   502 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 92ms · UTC 21:45 · PVG 05:45 · LAX 13:45 · JFK 16:45
    ♥ Do have faith in what you're doing.