如何使用正确版本的python(OSX)?

时间:2018-05-04 22:30:38

标签: python version

我安装了以下版本的python。

$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
$ which python3
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
$ which python2
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2

allennlp安装在这里。

$ which allennlp
/Library/Frameworks/Python.framework/Versions/3.6/bin/allennlp

但是当我运行allennlp时。它显然使用了python版本2.我不想手动编辑allennlp或者创建一个指向python3的新的python符号链接。

$ echo "The cryptocurrency space is now figuring out to have the highest search on Google globally ." > sentences.txt
$ echo "Bitcoin alone has a sixty percent share of global search ." >> sentences.txt
$ allennlp elmo sentences.txt elmo_layers.hdf5
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named allennlp

有谁知道处理这种情况的最佳方法是什么?感谢。

0 个答案:

没有答案