Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spyder reports invalid alias when running any script

Tags:

python

spyder

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
like image 282
pitosalas Avatar asked Mar 03 '19 16:03

pitosalas


4 Answers

As indicated on the issue tracker, IPython 7.7.0 sorted out this problem. I can confirm updating to 7.7.0 worked for me (conda 4.7.10 on Ubuntu 18.04, Spyder 3.3.6).

like image 155
fabio_hirono Avatar answered Oct 21 '22 22:10

fabio_hirono


I met same situation today, and I checked as following.
conda create -n testenv python spyder ipython=7.3
The issue happen.

conda create -n testenv python spyder ipython=7.2.0
In this environment, it doesn't happen.

I recommend you to rebuild your environment using ipython7.2.0 or downgrade with this:

conda install ipython=7.2.0
like image 24
yazaemon Avatar answered Oct 21 '22 22:10

yazaemon


conda install ipython=7.2.0 worked for me. ipython 7.3.0 was the culprit.

like image 38
Never Too Old To Learn Avatar answered Oct 22 '22 00:10

Never Too Old To Learn


The root cause can be traced down to this commit to ipython. Downgrading to ipython=7.2.0 certainly helps. Hope this can be fixed soon.

like image 37
Yu-Ann Chen Avatar answered Oct 22 '22 00:10

Yu-Ann Chen