Mac默认Python

2024-09-28 22:12:38 发布

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

如何将mac上的python设置回默认的引用位置?当我要做的时候

sudo easy_install virtualenv

我得到以下结果

dyld: Library not loaded: @rpath/Python
  Referenced from: /Users/a1ctesta/Library/Enthought/Canopy_64bit/User/bin/python
  Reason: image not found

我再也没有安装天篷,所以我想把它恢复到计算机上的原始引用。


Tags: installfromvirtualenvmaceasylibrarysudonot
3条回答

我也有同样的问题。重新安装顶棚是最容易的。从Canopy preferences菜单中,将Canopy设置为默认的Python。然后重新启动计算机。https://support.enthought.com/hc/en-us/articles/204469700-Uninstalling-and-resetting-Canopy

确保

/usr/bin

先于

/Users/a1ctesta/Library/Enthought/Canopy_64bit/User/bin/python

要做到这一点:

  1. 在终点站

    export PATH =/usr/bin:/Users/a1ctesta/Library/Enthought/Canopy_64bit/User/bin/python

  2. 使用来验证这一点

    echo $PATH

您可能需要修改$PATH环境变量,以便/usr/bin位于自定义路径之前。要检查这是否是问题所在,请运行以下命令并查看/usr/bin是在自定义路径之前还是之后

$ echo $PATH

PATH环境变量通常在~/.bash_profile中设置,例如在我的系统上

export PATH=/opt/local/bin:/opt/local/sbin:/Developer/usr/bin:$PATH

这意味着/opt/local/bin中的python可执行文件优先于默认PATH中的可执行文件。

相关问题 更多 >