浣跨敤virtualenv鍜寁irtualenvwrapper鎼缓python鐨勮櫄鎷熺幆澧

鏈枃鐢ㄤ簬璁板綍python瀛︿範涓惌寤鸿櫄鎷熺幆澧

棣栧厛涓嬭浇濂絧ython2鍜宲ython3

pip install virtualenv

濡傛灉python瀹夎涓瘮杈冩參鐨勮瘽锛屽彲浠ヤ娇鐢ㄨ眴鐡f簮锛屽嵆

pip install -p https://pypi.douban.com/simple virtualenv

鐒跺悗浣跨敤

virtualenv test(椤圭洰鍚嶅瓧)

灏卞垱寤烘垚鍔熶簡 鐒跺悗鍒癝CRIPTS搴曚笅鐨勮繍琛宎ctivate.bat灏卞彲浠ヤ簡
閫鍑虹殑璇濆氨杩愯deactivate.bat

涓婇潰鎸囩殑鏄粯璁や笅python涓2.7鐨勬儏鍐碉紝濡傛灉鐢佃剳瀹夎浜3.6鐨勭増鏈紝閭d箞灏辨槸

virtualenv -p python3鐨刾ython.exe鐨勮矾寰    椤圭洰鍚嶅瓧

涓婇潰璁茬殑鏄湪window搴曚笅鐨勫畨瑁咃紝鎺ヤ笅鏉ヨ鐨勬槸鍦╨inux搴曚笅鐨勫畨瑁
棣栧厛瀹夎virtualenv

sudo apt-get install python-virtualenv 

鍒涘缓椤圭洰鐨勬柟娉曟槸涓鏍风殑锛宭inux搴曚笅杩涘叆鐨勬槸bin鐩綍

鎼缓铏氭嫙鐜杩樻湁鍙﹀涓涓緢鏂逛究鐨勶紝鍙仛virtualenvwrapper,瀹夎涔熸槸鍚屾牱

pip install virtualenvwrapper-win

瀹夎瀹屽叏鍚庣湅涓涓嬩綘鏈変粈涔堣櫄鎷熺幆澧
鐢╳orkon 鍙兘闇瑕侀厤缃竴涓嬫湰鍦扮殑绯荤粺鐜锛岄粯璁ゆ槸鍦–鐩樺簳涓嬬殑envs
閭d箞閰嶇疆涓篧ORKON_HOME E:\Envs 鐜板湪鐨剋orkon灏辨寚鍚戝埌E鐩

鐜板湪鎼缓灏变负

mkvirtualenv 椤圭洰鍚嶇О

閫鍑虹殑鏂瑰紡鍜寁irtualenv涓鏍

deactivate

瀹夎杩囩▼涓鏋滃皯浜嗕粈涔堜緷璧栵紝鍙互鍒拌繖涓綉绔欎笂涓嬭浇
http://www.lfd.uci.edu/~gohlke/pythonlibs/

濡傛灉瑕佸畨瑁卲ython3鐨勮櫄鎷熺幆澧,灏辨槸

mkvirtualenv --python=c:\python3鐨勮矾寰刓python.exe py3(椤圭洰鍚嶇О)

linux搴曚笅鐨勬槸缂栬緫

vim ~/.bashrc
export WORKON_HOME=$HOME/ .virtualenv

鍏朵粬鐨勯兘宸笉澶 灏辫繖鏍峰惂

All posts

Other pages

鍙戣〃璇勮

鐢靛瓙閭欢鍦板潃涓嶄細琚叕寮銆 蹇呭~椤瑰凡鐢*鏍囨敞