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

2024-06-02 04:39:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我安装了以下版本的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

有人知道处理这个案子最好的办法是什么吗?谢谢。你知道吗


Tags: echo版本txtwhichsearchbinlibrarysentences