Ich habe Python 3.3 auf meinem Rechner installiert, aber da mag ich ein Programm verwenden, die 2.6 Python erfordert nur, wie kann ich von Python 3.3 zu Python 2.6Von Python 3.3 Python 2.6
Ich bewege tun verwende Ubuntu.
Ich habe Python 3.3 auf meinem Rechner installiert, aber da mag ich ein Programm verwenden, die 2.6 Python erfordert nur, wie kann ich von Python 3.3 zu Python 2.6Von Python 3.3 Python 2.6
Ich bewege tun verwende Ubuntu.
Verwenden python
statt python3
# Python2
$ python
Python 2.7.10 (default, Jul 30 2016, 18:31:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
# Python3
$ python3
Python 3.5.2 (default, Nov 7 2016, 17:25:58)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
Oder erklären in Ihrer Python-Dateien,
#!/usr/bin/env python
# -*- coding: utf-8 -*-
können Sie verschiedene Umgebungen schaffen für beide Versionen von Python verwenden, eine kurze Anleitung, wie zu tun es ist hier: https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/20/conda/
Alternativ: https://conda.io/docs/py2or3.html
'Python' vs 'python3' ist völlig abhängig davon, wie es installiert wurde ... keine allgemeine Lösung. Shebang ist gut, aber nur für * nix – Aaron
@Aaron, thx für das darauf hinweisen. – SparkAndShine