我不知道为什么会这样,但是当我更新(一切-conda update --all)时,它似乎已经开始了。自从我上次更新以来已经过了大约一年。某些东西一定已经改变了。

这是脚本:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar  3 11:25:22 2019

@author: pitosalas
"""

print("hello")

这是在spyder中按下绿色三角形的输出:
Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 11:07:29)
Type "copyright", "credits" or "license" for more information.

IPython 7.3.0 -- An enhanced Interactive Python.

runfile('/Users/pitosalas/Box Sync/datawork/2019Resubmit/deleteme.py', wdir='/Users/pitosalas/Box Sync/datawork/2019Resubmit')
ERROR:root:Invalid alias: The name clear can't be aliased because it is another magic command.
ERROR:root:Invalid alias: The name more can't be aliased because it is another magic command.
ERROR:root:Invalid alias: The name less can't be aliased because it is another magic command.
ERROR:root:Invalid alias: The name man can't be aliased because it is another magic command.
hello

最佳答案

issue tracker所示,IPython 7.7.0解决了此问题。我可以确认更新到7.7.0对我有用(在Ubuntu 18.04,Spyder 3.3.6上为conda 4.7.10)。

关于python - Spyder在运行任何脚本时报告无效的别名,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54971047/

10-14 19:34