python2.7とpython3.5の使い分けについてなのですが、私の環境には両方インストールしてあります。
[vagrant@localhost html]$ python -V
Python 2.7.5
[vagrant@localhost html]$ python3 -V
Python 3.5.2
普通にvim等でpythonファイルを作ることもできるし、実行することもできておりますが、どちらのpythonで動かしているのかが分かりません。
仮に、python2.7の方が動いているとすると、3.5を使いたい際はコード上で、3.5を使いますといった定義が必要となるのでしょうか。
virtualenvなどで共存させる方法を解説しているサイトはあるようですが、私はvirtualenvは入れておりません。
[vagrant@localhost html]$ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
backports.ssl-match-hostname (3.4.0.2)
configobj (4.7.2)
cycler (0.10.0)
decorator (3.4.0)
functools32 (3.2.3.post2)
iniparse (0.4)
matplotlib (2.0.2)
numpy (1.13.1)
perf (0.1)
PIL (1.1.7)
pip (9.0.1)
protobuf (3.0.0b2)
pycurl (7.19.0)
pygobject (3.14.0)
pygpgme (0.3)
pyliblzma (0.5.3)
pyparsing (2.2.0)
python-dateutil (2.6.0)
pytz (2017.2)
pyudev (0.15)
pyxattr (0.5.1)
setuptools (36.0.1)
six (1.10.0)
slip (0.4.0)
slip.dbus (0.4.0)
subprocess32 (3.2.7)
tensorflow (0.9.0)
urlgrabber (3.10)
wheel (0.29.0)
yum-metadata-parser (1.1.4)
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。