如何在命令提示符中爲Python 2和3設置永久路徑,以便我可以在每次打開命令窗口時調用命令窗口,即用於python 2解釋器的'python2'或用於python 3解釋器的'python3'Python雙重安裝
0
A
回答
0
創建一個python2.bat和一個python3.bat文件在你的路徑上(可以在你的主python文件夾中)。該文件只包含相關python.exe的位置,例如
C:\Programs\Python26\python.exe %*
0
只需使用python launcher:py -2
運行Python 2和py -3
運行的Python 3
如果你在你的腳本的頂部添加#! python3
(家當),然後將py your_script.py
使用Python 3,如果添加#! python2
然後它會自動使用Python 2。
相關問題
- 1. apk安裝雙面安裝
- 2. numpy雙重安裝(pip vs apt-get)
- 3. 安裝python ldap以單獨安裝python
- 4. 雙操作系統安裝
- 5. 無法重新安裝Python 3.5
- 6. Python安裝
- 7. python 2.7.2安裝
- 8. Python:安裝pygresql
- 9. 安裝python windows
- 10. 安裝Python庫
- 11. Ubuntu - Python安裝
- 12. Python庫安裝
- 13. 安裝Python dateutil
- 14. Python blpapi安裝
- 15. Python受挫安裝庫不會安裝
- 16. 安裝python 2.7沒有安裝gcc
- 17. 的Python安裝時PIP安裝的Gearman
- 18. pip安裝mysql-connector-python安裝錯誤
- 19. PIP安裝不安裝Python模塊
- 20. 安裝python的安裝工具
- 21. 安裝和重新安裝XAMPP
- 22. Python安裝python-ntlm-1.0
- 23. 用python安裝python的python_select?
- 24. 安裝時自動重裝
- 25. 安裝Python-pyxattr 17.04
- 26. 最小Python安裝
- 27. 安裝Python的2.7.13
- 28. 爲python安裝numpy
- 29. Python 3.4 - 安裝SciPy
- 30. 安裝Python模塊
你有什麼操作系統? – 2014-10-21 21:24:01
對於Windows 7: http://stackoverflow.com/questions/3809314/how-to-install-both-python-2-x-and-python-3-x-in-windows-7 – jgritty 2014-10-21 21:26:29
@ SimeonVisser Windows 7旗艦版 – user3731606 2014-10-21 21:27:45