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
140
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.6k
最近のNative Modules開発について
roothybrid7
0
1.1k
Other Decks in Programming
See All in Programming
Nuances on Kubernetes - RubyConf Taiwan 2025
envek
0
190
[FEConf 2025] 모노레포 절망편, 14개 레포로 부활하기까지 걸린 1년
mmmaxkim
0
990
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
170
decksh - a little language for decks
ajstarks
4
21k
未来を拓くAI技術〜エージェント開発とAI駆動開発〜
leveragestech
2
180
DockerからECSへ 〜 AWSの海に出る前に知っておきたいこと 〜
ota1022
5
1.8k
Flutterと Vibe Coding で個人開発!
hyshu
1
260
A Gopher's Guide to Vibe Coding
danicat
0
170
🔨 小さなビルドシステムを作る
momeemt
1
490
物語を動かす行動"量" #エンジニアニメ
konifar
14
5.4k
Honoアップデート 2025年夏
yusukebe
1
850
Google I/O recap web編 大分Web祭り2025
kponda
0
2.9k
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1031
460k
The Cult of Friendly URLs
andyhume
79
6.5k
Being A Developer After 40
akosma
90
590k
Automating Front-end Workflow
addyosmani
1370
200k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
Done Done
chrislema
185
16k
Faster Mobile Websites
deanohume
309
31k
Building Applications with DynamoDB
mza
96
6.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
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༵