Install python3 on MacOS:

brew install python3

Come alone with python3, there are also some other tools are installed as well, for examlpe: 'pip, setuptools'...

We need 'pip' to help us install virtualenv.

Why virtualenv?

Main reason is to resolve the libaraies conflict for different django project. So for each project, you should create new virtual env, and install libraries only for this project, NEVER globally!

Install:

pip3 install virtualenv

Before create a new virtual env, we need to check the python3 location:

which python3

And in my case, it is:

/usr/local/bin/python3

Create new virtual env:

virtualenv -p /usr/local/bin/python3 myFirstProject

Go to the env folder we just create and start working on this env:

cd myFirstProject
. bin/activate

Now we are in the virtual env, we can start install django:

pip install django

To make sure and get familiar where those libraries are installed, we can go to:

ls lib/python3./site-packages

And you should be able to find django is there.

And also you can type:

python   // type paython

>>> import django   // import django lib
>>> django.VERSION // see the verison (, , , 'final', ) // prints out


Other way to create new env with >python3.3 only:

python3 -m venv demo

Deactive you env:

deactivate

List all the libararies:

pip list

[Django] Get started with Django -- Install python and virtualenv的更多相关文章

  1. Install Python+Django+Nginx+UWSGI

    一.软件环境: CentOS6.6_64bit 需要用到的软件: [root@django tools]# ll 总用量 33336 -rw-r--r-- 1 root root 7497785 3月 ...

  2. install python+twisted+mysqldb+django on mac

    一. install python 1) check install or not 在mac终端输入命令:which python 即可查看python的路径 2)未安装时,手动下载安装包 地址:ht ...

  3. CentOS 5系统安装Django、Apache 、mod_wsgi部署Python环境教程

    Django,是一款针对Python环境的WEB开发框架,能够帮助我们构架快捷.简单的WEB框架设置,Django框架非常适合开发内容应用环境,所以在本文中,麦子将整理基于Centos系统部署安装Dj ...

  4. python框架之Django(1)-第一个Django项目

    准备 自己写一个简单的webServer import socket # 生成socket实例对象 sk = socket.socket() # 绑定IP和端口 sk.bind(("127. ...

  5. python 全栈开发,Day69(Django的视图层,Django的模板层)

    昨日内容回顾 相关命令: 1 创建项目 django-admin startproject 项目名称 2 创建应用 python manage.py startapp app名称 3 启动项目 pyt ...

  6. django中将views.py中的python方法传递给html模板文件

    常规的模板渲染 from django.db import models # Create your models here. class ArticalType(models.Model): cap ...

  7. [python][django学习篇][4]django完成数据库代码翻译:迁移数据库(migration)

    上一篇我们已经完成数据库的设计,但是仅仅是python语言,并没有真正创建了数据库表.翻译成数据库语言,真正创建数据库表由django manage.py来实现,这一过程专业术语:迁移数据库 切换到m ...

  8. Django入门到进阶-更适合Python小白的系统课程

    Django入门到进阶-更适合Python小白的系统课程 整个课程都看完了,这个课程的分享可以往下看,下面有链接,之前做java开发也做了一些年头,也分享下自己看这个视频的感受,单论单个知识点课程本身 ...

  9. [Django 1]安装Django并创建虚拟虚拟环境项目

    1)安装Django 使用pip来安装,命令如下: pip3 install Djangopip install Django(安装到python2)python3 -m pip install Dj ...

随机推荐

  1. 第二十八天 月出惊山鸟 —Spring的AOP

    6月13日,阴转细雨."人闲桂花落.夜静春山空. 月出惊山鸟.时鸣春涧中." 无论在面向过程还是在面向对象里,奇妙的"纯"字,似乎永远都充满了无限的可能性.除了 ...

  2. html5 audio标签相关知识点总结

    1.audio指JS原生对象,假如用jquery获取到audio标签后,需要dom[0]转为原生JS对象 if(audio.paused){ //如果音频暂停,就播放 audio.play(); }e ...

  3. DataTable +chart控件

    //这是仿你的DataTable //-----开始--------- DataTable dataTable1 = new System.Data.DataTable(); dataTable1.C ...

  4. PatentTips - Adaptive algorithm for selecting a virtualization algorithm in virtual machine environments

    BACKGROUND A Virtual Machine (VM) is an efficient, isolated duplicate of a real computer system. Mor ...

  5. session的生命周期是怎样的

    session的生命周期是怎样的 一.总结 一句话总结:Tomcat中Session的默认失效时间为20分钟.如果我们敲代码的时候把它设置成1个月,那么这一个月的数据会代替默认20分钟的数据,使ses ...

  6. Kaggle实战分类问题2

    Kaggle实战之二分类问题 0. 前言 1. MNIST 数据集 2. 二分类器 3. 效果评测 4. 多分类器与误差分析 5. Kaggle 实战 0. 前言 “尽管新技术新算法层出不穷,但是掌握 ...

  7. Windows 64位下 python3.4.3 安装numpy scipy

    Numpy: 1.在开始菜单搜索cmd打开 终端 2.在终端输入python -m pip install -U pip 3.到http://www.lfd.uci.edu/~gohlke/pytho ...

  8. 资源下载https://msdn.itellyou.cn/

    资源下载https://msdn.itellyou.cn/  迅雷

  9. 每日技术总结:setInterval,setTimeout,文本溢出,小程序,wepy

    前言: 项目背景:vue,电商,商品详情页 1.倒计时,倒计到0秒时停止 data () { return { n: 10 } }, created () { let int = setInterva ...

  10. 2、HZK和FreeType的使用

    HZK16汉字库的使用 定义如下: unsigned char str[]="我" 在运行时str被初始化为2个字节长度,内容为“我”的GBK码,为:0xCE(区码),0xD2(位 ...