swift抛出终端的python错误

前端之家收集整理的这篇文章主要介绍了swift抛出终端的python错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
每当我尝试启动与 python相关的swift时,我都会收到错误.我该如何解决? @H_403_1@

bash-3.2$swift –version
Apple Swift version 4.1 (swiftlang-902.0.48 clang-902.0.37.1)
Target: x86_64-apple-darwin17.5.0
bash-3.2$swift
Traceback (most recent call last):
File “”,line 1,in
File “/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py”,line 52,in
import weakref
File “/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.py”,line 14,in
from _weakref import (
ImportError: cannot import name _remove_dead_weakref

我得到同样的错误,因为swift REPL使用安装在/usr/local / bin / python的自制软件的python解释器.

为了避免这种情况你可以

export PATH=/usr/bin:$PATH
swift

要么

PATH=/usr/bin:$PATH swift
原文链接:https://www.f2er.com/swift/318596.html

猜你在找的Swift相关文章