我正在使用 链接卸载macports,而是安装homebrew。但是,我在第一步遇到错误。我跑 sudo port -f uninstall installed 我的终端(顺便说一句,我在mac上),它向我吐出这个 :

Warning: port definitions are more than two weeks old, consider using selfupdate
Warning: configured user/group macports does not exist, will build as root
---> Uninstalling python27 @2.7.1_3
Error: Target org.macports.uninstall returned: error deleting "/opt/local/var/macports/software/python27/2.7.1_3": directory not empty
Log for python27 is at: /opt/local/var/macports/logs/_opt_local_var_macports_registry_portfiles_python27_2.7.1_3/python27/main.log
Warning: Failed to execute portfile from registry for python27 @2.7.1_3 
--->  Uninstalling python27 @2.7.1_3
Error: port uninstall failed: error deleting "/opt/local/var/macports/software/python27/2.7.1_3": directory not empty

我不太确定这个东西是什么意思,也不太熟悉macports。我甚至不认为我用macports安装了python。..

有帮助吗?

解决方案

如果你要删除macports,我会做删除

sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports

您得到的第一个警告是由于没有最新版本的macports,因此运行selfupdate。对于错误,您需要查看建议的日志 /opt/local/var/macports/logs/_opt_local_var_macports_registry_portfiles_python27_2.7.1_3/python27/main.log

Macports在没有您询问的情况下安装python的原因可能是因为您询问了需要使用python的端口。Macports将安装自己的python,以便它确切地知道python使用了哪个版本和编译选项,因为长期使用unix vendpors的开发人员发现供应商(例如苹果)可以改变事情并导致问题(请参阅Xcode的最新更新以获取一个很好的例子),或者不提供所需的后续错误修复。自制软件信任苹果,所以会使用苹果的版本

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top