首页 > 解决方案 > Spyder reports invalid alias when running any script

问题描述

I can't tell why this is happening but it seems to have started when I updated (everything - conda update --all). It had been about 1 year since I last had updated. Something must have changed.

Here is the script:

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

@author: pitosalas
"""

print("hello")

And here is the output from pressing the green triangle in 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

标签: pythonspyder

解决方案


我今天遇到了同样的情况,我检查如下。
conda create -n testenv python spyder ipython=7.3
问题发生。

conda create -n testenv python spyder ipython=7.2.0
在这种环境下,它不会发生。

我建议您使用 ipython7.2.0 重建您的环境或降级:

conda install ipython=7.2.0

推荐阅读