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
CSC305 Lecture 26
javiergs
PRO
0
140
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
910
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
440
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
330
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
280
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
450
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
103 Early Hints
sugi_0000
1
230
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
200
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Done Done
chrislema
181
16k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Designing for Performance
lara
604
68k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Visualization
eitanlees
146
15k
Mobile First: as difficult as doing things right
swwweet
222
9k
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༵