python - 如何使用正确版本的python(OSX)?
问题描述
我安装了以下版本的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
有谁知道处理这种情况的最佳方法是什么?谢谢。
解决方案
推荐阅读
- python - 如何在 Ubuntu 上删除多个版本的 python
- javascript - 没有得到准确的位置
- c# - 同时运行 ASP.NET 网页和 MVC
- sql-server - 如何在 SQL 中获取下一个自动增量 ID
- git - 将一个子目录推送到 Github,但该文件夹显示为灰色,并带有我从未见过的图标。无法访问文件夹的内容
- spring-boot - Spring Boot 2 控制器返回一个可调用但 http 响应仍然为空
- asp.net-core - ASP.net Core - Signalr 断开连接后处理客户端信息服务器端
- python - 将日期时间格式从日期更改为日期时间
- android - 为叠加图像着色
- wpf - C# WPF 画笔模糊画布