ipython / ipython

Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.
https://ipython.readthedocs.org
BSD 3-Clause "New" or "Revised" License
16.25k stars 4.43k forks source link

[TerminalIPythonApp] WARNING | Unrecognized alias: 'im', it will have no effect. #12564

Open kalvdans opened 3 years ago

kalvdans commented 3 years ago

I'm used to write ipython -im <modulename> to do interactive Python hacking. However, on one installation it doesn't work.

Working machine:

(env) brahe$ ipython -im os
Python 3.8.2 (default, Jul 16 2020, 14:00:26) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: path
Out[1]: <module 'posixpath' from '/usr/lib/python3.8/posixpath.py'>

In [2]: 

Non-working machine:

(env) arvid-m12$ ipython -im os
[TerminalIPythonApp] WARNING | Unrecognized alias: 'im', it will have no effect.
Python 3.8.2 (default, Jul 16 2020, 14:00:26) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: path
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-012ab3a6b187> in <module>
----> 1 path

NameError: name 'path' is not defined

Both machines have the same versions, only from pip and no system installation:

$ dpkg --list | grep ipyth
$ pip list | grep ipyth
ipython            7.18.1
ipython-genutils   0.2.0

Using python -i -m os works on both machines.

mxjeff commented 3 years ago

Looks related to #12711, try to split options:

ipython -i m os
Symbadian commented 2 years ago

hey, @kalvdans and @mxjeff,

I am experiencing a similar error and I am not sure how to interpret this.

Maybe someone can assist here as well, please?

''' Python 3.9.7 (default, Sep 16 2021, 08:50:36) Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

help(runfile) Help on function runfile in module spydercustomize:

runfile(filename=None, args=None, wdir=None, namespace=None, post_mortem=False, current_namespace=False) Run filename args: command line arguments (string) wdir: working directory namespace: namespace for execution post_mortem: boolean, whether to enter post-mortem mode on error current_namespace: if true, run the file in the current namespace

runfile('/Users/symbadian/Desktop/Full Experiments/Experiments/3DCNN Template/packages.py', wdir='/Users/symbadian/Desktop/Full Experiments/Experiments/3DCNN Template', current_namespace=True)

WARNING: This is not valid Python code. If you want to use IPython magics, flexible indentation, and prompt removal, we recommend that you save this file with the .ipy extension.

runfile('/Users/symbadian/3DCNNtesting/packages.ipy', wdir='/Users/symbadian/3DCNNtesting', current_namespace=True) [TerminalIPythonApp] WARNING | Unrecognized alias: 'batch', it will have no effect. [TerminalIPythonApp] WARNING | Unrecognized alias: 'epoch', it will have no effect. [TerminalIPythonApp] WARNING | Unrecognized alias: 'videos', it will have no effect. [TerminalIPythonApp] WARNING | Unrecognized alias: 'nclass', it will have no effect. [TerminalIPythonApp] WARNING | Unrecognized alias: 'output', it will have no effect. [TerminalIPythonApp] WARNING | Unrecognized alias: 'color', it will have no effect. [TerminalIPythonApp] WARNING | Unrecognized alias: 'skip', it will have no effect. [TerminalIPythonApp] WARNING | Unrecognized alias: 'depth', it will have no effect.

'''

kalvdans commented 2 years ago

@MatParr, it might be the same issue, but please bring it up in the spydercustomize forums first, since that's where the runfile function comes from.

Symbadian commented 2 years ago

Ok thanx @kalvdans for your response nevertheless, where is the connecting link for such forum? Send over please and I would do the needful

kalvdans commented 2 years ago

@MatParr Let's continue on email to not put unrelated discussion in this issue, my email is ipython@kalvdans.no-ip.org

Symbadian commented 2 years ago

@kalvdans great, reaching out to you in a short.

Symbadian commented 2 years ago

@kalvdans Hey Pal, I finally figured it out, Obtain package compatibility: I got rid of the spyder application with the help of a friend from discord and it was not showing the errors for such stuff on the new M1 macs. I ran this directly from the terminal and this displayed outdated packages that required upgrades. I AM not sure what cause spyder to not be able to recognize such an issue. Maybe a professional can explain further.

I have the same code running fully on the terminal as spyder was experiencing all sorts of glitches, sadly I had to part way with it after using such for so long.

I am really hoping they fix this and as of just now the anaconda navigator is still problematic when downloading such from the website, it's not running even when deploying the bash file approach still the same. What a shame!!