如何在命令提示符中爲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. Mac重新安裝Python
- 4. 在安裝Python 3後安裝Python 2.7
- 5. 安裝MySQL後python安裝失敗-python
- 6. 安裝python ldap以單獨安裝python
- 7. 雙操作系統安裝
- 8. python python安裝包
- 9. 如何將python 3.4默認設置爲2.7以上的雙重安裝
- 10. 無法重新安裝Python 3.5
- 11. 重新安裝GDAL庫爲Python 2.7
- 12. 不能安裝裝配Scrapy /雙絞線
- 13. 安裝Python庫
- 14. python 2.7.2安裝
- 15. 安裝reindent python
- 16. 安裝ImageUtils python
- 17. 安裝python windows
- 18. Ubuntu - Python安裝
- 19. Python:安裝pygresql
- 20. Python安裝mpi4py.MPI
- 21. Python line_profiler安裝
- 22. Python庫安裝
- 23. 安裝Python dateutil
- 24. Python安裝
- 25. Jinja安裝python
- 26. Python GDal安裝
- 27. Python blpapi安裝
- 28. 安全雙重檢查
- 29. Python受挫安裝庫不會安裝
- 30. 安裝python 2.7沒有安裝gcc
你有什麼操作系統? – 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