在 OS X 10.10 下,在 PyCharm 中使用 VirtualBox 设置 Vagrant 时出错

2024-01-10

当设置远程解释器并选择 Vagrant 时,我在 PyCharm 中收到以下错误:

Can't Get Vagrant Settings: [0;31mThe provider 'virtualbox' that was requested to back the machine 'default' is reporting that it isn't usable on this system. The reason is shown bellow: Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed. Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires this to be available on the PATH. If VirtualBox is installed, please find the `VBoxManage` binary and add it to the PATH environment variable.[0m

现在,从终端来看,一切正常。我可以毫无问题地“up”并通过 ssh 进入虚拟机。端口以及本地文件都会被转发。所以问题只出现在 PyCharm 中。我已经安装了Java 1.8

路径是: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

其中 VBoxManage: /usr/local/bin/VBoxManage 并在终端中工作。

请注意,这是今天早上完成的 OS X 全新安装。 Vagrant 版本是 1.7.3,VirtualBox 是 4.3.30,PyCharm 是 4.5.3


另一个解决方法:

sudo ln -s /usr/local/bin/VBoxManage /usr/bin/VBoxManage

Edit:

由于这一切都在前一段时间起作用,因此以下原因之一必定是导致此问题的原因:

  • VirtualBox 的更新或更改其可执行文件的位置
  • 或更新 PyCharm 更改了 IDE 的 PATH 设置/可执行位置预期

无论原因是什么,解决方案是确保 VBoxManage 位于 PyCharm 预期的位置。我自己没有提出这个解决方案,只是用谷歌搜索它,但因为它是如此的漂亮和干净,我决定将它添加到这里。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 OS X 10.10 下,在 PyCharm 中使用 VirtualBox 设置 Vagrant 时出错 的相关文章

随机推荐