2015年4月1日 星期三

使用 Virtualenv 建立獨立的 Python 環境

安裝 virtualenv
$ pip install virtualenv
建立 Python 虛擬環境
$ virtualenv ENV
可以加 --python 指定版本
$ virtualenv --python=python2.7 ENV
或加 --no-site-packages 不依賴系統已安裝的 Python 套件
$ virtualenv --no-site-packages ENV
其中 ENV 是放虛擬環境的目錄,刪除目錄就可以移除虛擬環境。

啟動虛擬環境
$ source ENV/bin/activate
離開虛擬環境
(ENV)$ deactivate
撰寫 script 也可以指定虛擬環境
#!/path/to/ENV/bin/python

...
參考

1 則留言:

  1. Machines are typically grouped by denomination, style and brand name. Video slots have a HELP or INFO button that may walk you thru the assorted payouts, play traces, bonus games and particular options. In this article, we'll find out what sets the reels in movement in fashionable slot machines nicely as|in addition to} 우리카지노 within the old mechanical fashions. We'll also see what determines the odds of winning on a slot machine and a glance at|have a glance at} some in style variations on the standard game.

    回覆刪除