Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
python_virenv.pdf
Search
Satoshi Ohki
November 15, 2012
Programming
1
130
python_virenv.pdf
社内LTで発表した資料
Satoshi Ohki
November 15, 2012
Tweet
Share
More Decks by Satoshi Ohki
See All by Satoshi Ohki
カートリプレースPJの全体像と技術選定
roothybrid7
0
1.4k
最近のNative Modules開発について
roothybrid7
0
1k
Other Decks in Programming
See All in Programming
距離関数を極める! / SESSIONS 2024
gam0022
0
280
Click-free releases & the making of a CLI app
oheyadam
2
120
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
120
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
Remix on Hono on Cloudflare Workers
yusukebe
1
290
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
88
5.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
A designer walks into a library…
pauljervisheath
204
24k
Gamification - CAS2011
davidbonilla
80
5k
Designing for humans not robots
tammielis
250
25k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
For a Future-Friendly Web
brad_frost
175
9.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Transcript
MacOSXͰ࡞Δ PythonԾڥ 2012/11/16 roothybrid7 1211݄17༵
։ൃڥߏங • స৬ͯ͠ॳΊͯͷ͓ࣄ!! • Ұ͕͔Γ!? • େม? 1211݄17༵
ͳΜߟ͑ͣ͑Δ • खॱؒҧ͑ͨʔ • ͍Βͳ͍ͷΞϯΠϯετʔϧͰ͖Ͷʔ • ཧπʔϧಈ͔Ͷʔ 1211݄17༵
Pythonͷ։ൃڥ • easy_installͱ͔pipͱ͔ɺsetuptoolsͱ ͔distributeͱ͔Կ͕ҧ͏ͷ? • ϓϩδΣΫτຖʹ༻͢Δύοέʔδ͕ ҟͳΔͱ͖Կ͍͍͑ͷ? 1211݄17༵
ଞʹ • όʔδϣϯΛҙࣝ͠ ͯɺίϚϯυ࣮ߦ͢Μ ͷΊΜͲ͍ • όʔδϣϯΞοϓͨ͠ ͍ͱ͖ɺҠߦΊΜͲ͍ • ڥߏஙࣦഊͨ͠ͱ
͖ɺϦΧόϦ͕ΊΜͲ ͍ 1211݄17༵
ࣦഊΏΔ͞ΕΜ! 1211݄17༵
PythonΠϯετʔϧ • HomebrewͰΠϯετʔϧ͕͓͢͢Ί • brew tap homebrew/versions ͰϦϙδ τϦՃ͢ΔͱΠϯετʔϧՄೳͳόʔ δϣϯ͕૿͑Δ
1211݄17༵
Virtualenv • ԾڥΛ࡞ͬͯ͘ΕΔ • pip install virtualenv • ԾڥΛɺ؆୯ʹՃআ͕Մೳ •
ԾڥͰɺࢦఆͨ͠Pythonͷό ʔδϣϯͰಈ࡞͢ΔͷͰɺ͍͍ͪͪόʔ δϣϯΛҙࣝ͠ͳͯ͘Α͍ 1211݄17༵
Virtualenvwrapper • ͱ͍͑ɺVirtualenv୯ମͩͱԾڥ ΛͲ͜ͷσΟϨΫτϦͰ࡞͔ͨ͠Ͱ ཧ͕ࡶʹͳΔͷͰɺϥούʔ͕༻ҙ͞ Ε͍ͯΔɻ =>͜ΕΛͬͯڥΛߏங(pipͰΠϯε τʔϧ) 1211݄17༵
xshrc(bashrc, zshrc) • virtulenvwrapperΛ ͏ઃఆ • ԾڥҰׅͰཧ • cd(σΟϨΫτϦҠಈ) ͷ࣌ʹউखʹԾڥ
͕ΓସΘΔΑ͏ʹࡉ [alias cd=‘venv_cd’] 1211݄17༵
ԾڥΛ࡞͢Δ $ mkvirtualenv <env> [--python=<python path>] 1211݄17༵
ԾڥΛআ͢Δ $ rmvirtualenv <env> 1211݄17༵
cdͰԾڥΓସ͑ $ workon <env> # ্ͷɺcdͨ͠ͱ͖ʹ`.venv`ϑΝΠϧʹॻ͔Εͨ # env໊ΛݟͯΓସ͑ͯ·͢ # .zshrc(.bashrc)ʹworkonΛ࣮ߦ͢ΔؔΛఆٛ
1211݄17༵
ڥΛҠߦ͢Δ $ pip freeze >requirements.txt $ mkvirtualenv new_env $ pip
install -r requirements.txt 1211݄17༵
͓ΘΓ 1211݄17༵