【问题标题】:macports python_select command not found未找到 macports python_select 命令
【发布时间】:2011-09-01 06:46:03
【问题描述】:

我正在使用 MacPorts 并安装了 python_select 在 2.6 和 2.7 之间切换。但由于某种原因,我现在在运行时收到“找不到命令”错误:

sudo python_select python26 

$PATH 可能有问题?不知道在哪里寻找它。

【问题讨论】:

    标签: macports


    【解决方案1】:

    python_select 不是命令,它是添加到port select 的功能。

    使用它:

    1. 列出可供选择的可用 python:

      port select --list python
      
    2. 选择特定端口(例如python26):

      port select python python26
      


    【讨论】:

    • python_select 曾经是一个命令 - 端口选择现在已取代它。
    • 我认为你必须 sudo port select ... 然后可能第一次运行 sudo python 以便它可以自行设置(除非你的用户具有对 /opt 的写入权限)
    【解决方案2】:

    查看后续问题重构的答案:

    macports didn't place python_select in /opt/local/bin

    【讨论】:

      【解决方案3】:

      嗯,在我的 Lion 上,我使用:-

      $ sudo port select --list python
      

      查看可用的 python 版本,并且:-

      $ sudo port select python python26
      

      我不需要_! YMMV

      【讨论】:

      • 这与之前的answer有何不同或改进
      猜你喜欢
      • 2020-10-10
      • 1970-01-01
      • 2011-09-03
      • 1970-01-01
      • 2010-12-18
      • 2013-03-25
      • 2011-12-03
      • 1970-01-01
      • 2017-05-05
      相关资源
      最近更新 更多