---
title: "Pylons笔记（一）"
author: "waveeee"
date: "2011-05-19T15:01:59Z"
tags: []
categories: ["编程语言"]
slug: "pylons"
draft: false
lastmod: "2011-05-19T17:11:22Z"
id: 1050294
url: "https://waveeee.iteye.com/blog/1050294"
---

工作上使用pylons有几个星期了，零零散散的，在这里整理一下。

 

第一天

 

环境

freebsd 8.1

python2.6.6

 

首先安装自己的环境运行环境。

一台机可以同时运行多个不同的环境，这样可以保证你的运行环境所包含的包，同时多个环境可以独立运行。

 

1，下载创建脚本  

 

wget http://pylonsbook.com/virtualenv.py

 

2， 创建虚拟环境到指定目录env

 

python virtualenv.py --no-site-packages /home/lign/env

 

3，安装pylons到你的env

 

/home/lign/env/bin/easy\_install "pylons" 

 

4, 激活（退出deactivate）环境

 

 

\[lign@free ~]$ source /home/lign/env/bin/activate    

(env)\[lign@free ~]$ 

 

 

 

(env)\[lign@free ~]$ deactivate

\[lign@free ~]$ 

 

 

5，如果使用过程中需要安装什么包可以尝试使用easy\_install package-name

 

easy\_install PasteDeploy

 

 

 

参考：

[http://pylonsbook.com/en/1.1/](http://pylonsbook.com/en/1.1/)

 

[**http://hi.baidu.com/zhuifengdenanhai/blog/category/The%20Definitive%20Guide%20To%20Pylons/index/1**](http://hi.baidu.com/zhuifengdenanhai/blog/category/The%20Definitive%20Guide%20To%20Pylons/index/1)