GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve our error messages for non compatibility. by Carreau · Pull Request #9900 · ipython/ipython

Conversation

@Carreau

@Carreau Carreau commented Aug 23, 2016

Copy link
Copy Markdown
Member

I would like to have the transition (even on master) as smooth as possible, with good error message.

There is a large number of instruction that explain how to install ipython from source on the internet, and we can make an effort for all the python 2 users around that will encounter that to have a seamless transition or at least a good error message.

Otherwise we will get a lot of bug report from users.

One of the thing we can do, is to actually open an issue just for that, and point to this issue number in the error messag, plus update this issue with instructions.

The following is not super friendly:

$ python2 -m pip install .
Processing /Users/bussonniermatthias/dev/ipython
    Complete output from command python setup.py egg_info:
    ERROR: IPython requires Python version 3.3 or above.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /var/folders/ld/jy0c_5d91rl_s3jqh74tmqn00000gn/T/pip-_zeInP-build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Carreau

Carreau commented Aug 23, 2016

Copy link
Copy Markdown
Member Author

@willingc I would appreciate any of your insight on the error message.

I'd like @fperez and @ellisonbg input on this process.

I even think that a real multine error that also give some (basic) reasoning as why we stop support, and how to get the 5.x branch woudl be welcome.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fperez

fperez commented Aug 23, 2016

Copy link
Copy Markdown
Member

I think this PR is already a big improvement. I wonder if it would be useful to host a permanent page with a bit more detail, and include a bit.ly URL to it in the message. Something like bit.ly/ipy23 or similar that we can control and redirect in the future if our website layout ever changes.

But this is already a good start!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Carreau

Carreau commented Aug 23, 2016

Copy link
Copy Markdown
Member Author

I think we can do better, I don't know if we have a bit.ly account, and that would be fine with me to have an updatable page. .

$ python2 -m IPython
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 163, in _run_module_as_main
    mod_name, _Error)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 111, in _get_module_details
    __import__(mod_name)  # Do not catch exceptions initializing package
  File "IPython/__init__.py", line 61, in <module>
    """)
ImportError:

============== IPython 6.0+ requires Python version 3.3 or above. =============
|
| For a version compatible with Python 2.7, please install the 5.x Long Term
| Support version.
|
| If you are encountering this error message you are likely trying to be using
| IPython from source. You need to checkout the remote 5.x branch, likely:
|
|   $ git fetch origin
|   $ git checkout -b origin/5.x
|
| If you encounter this error message with a regular install of IPython, then you
| likely need to update your package manager, for example if you are using `pip`
| check the version of pip with
|
|   $ pip --version
|
| You will need to update pip to the version 8.2 or greater. If you are not using
| pip, please inquiry with the maintainers of the package for your package
| manager.
|
| For more information see one of our blog posts:
|
|     http://blog.jupyter.org/2016/07/08/ipython-5-0-released/
|
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Carreau

Carreau commented Aug 23, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Also once we agree on the message, we need to duplicate it in setup.py.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fperez

fperez commented Aug 23, 2016

Copy link
Copy Markdown
Member

I'm just not convinced that an exception traceback is the place for long-form instructions. That's why I think that it's better to point to the source of the problem and link to a persistent resource with more details.

Putting tutorials into tracebacks is, I think, stretching too far the intent of an error message.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

willingc
willingc reviewed Aug 23, 2016
View reviewed changes
Comment thread IPython/__init__.py Outdated
if sys.version_info < (3,3):
raise ImportError('IPython 6.0+ requires Python version 3.3 or above. '
'For a version compatible with Python 2.7, please install'
' the 5.x Long Term Support version.')

@willingc willingc Aug 23, 2016

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raise ImportError('IPython 6.0+ does not support Python 2.7, 3.0, 3.1, or 3.2. '
                             'When using Python 2.7, please install IPython 5.x LTS Long Term Support version. '
                             'Beginning with IPython 6.0, Python 3.3. and above is required.') 

Since the error message will be going to someone that does not have 3.3+ installed, the above error message using the following: 1. Tell them the error. 2. Tell them the resolution (use 5.x LTS). 3. Tell them why.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Carreau

Carreau commented Aug 23, 2016

Copy link
Copy Markdown
Member Author

That's one of my other questions, should we only raise (just for imports), or should we print + sys.exit(nonzero) ? Note that we are doing that in setup.py, so the error message can easily be as long as we want, it is not a traceback.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@willingc

willingc commented Aug 23, 2016

Copy link
Copy Markdown
Member

Perhaps for simplicity, it would be good to have a brief error message as I suggest in the code review. One sentence that could be added to the error message that refers to a changelog. For example,

raise ImportError('IPython 6.0+ does not support Python 2.7, 3.0, 3.1, or 3.2. '
                             'When using Python 2.7, please install IPython 5.x LTS Long Term Support version. '
                             'Beginning with IPython 6.0, Python 3.3. and above is required.'
                             'See CHANGELOG.md and IPython documentation for details.') 

We could add a CHANGELOG.md file at the repo's root with @Carreau's longer error text re: IPython 6.x and link to the docs from there. The CHANGELOG.md would be easy to update as needed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fperez

fperez commented Aug 23, 2016

Copy link
Copy Markdown
Member

A Changelog file is really tricky to maintain in a distributed VC environment as it easily leads to merge conflicts. And I'd rather not start a ChangeLog again (we used to have one), since now our release process instead generates its equivalent out of the github PR and issue list.

But, iterating on this idea: how about instead we add a short section on this topic at the end of the main README.md? This is likely important enough to warrant mention there for a while to come, and that would mean it's available to the users always right next to them (if they are installing from source, by definition they have the README.md).

So, we could keep the short & sweet error message as per @willingc's suggestion in the code, and a bit more info at the end of the README.

That would, I think, satisfy the constraints, obviate the need for managing a separate URL, and pick up on the Changelog idea without the issues that specific kind of file brings up.

Thoughts?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Carreau
Carreau force-pushed the update-no-2x branch from 4cb6b8a to 69116c8 Compare August 23, 2016 19:18
@Carreau

Carreau commented Aug 23, 2016

Copy link
Copy Markdown
Member Author

Done.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@willingc

willingc commented Aug 23, 2016

Copy link
Copy Markdown
Member

Iteration FTW. @fperez Great suggestion.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Carreau
Improve our error messages for non compatibility.
e29b23d
@Carreau
Carreau force-pushed the update-no-2x branch from 69116c8 to e29b23d Compare August 23, 2016 19:23
@Carreau

Carreau commented Aug 23, 2016

Copy link
Copy Markdown
Member Author

Iteration FTW. @fperez Great suggestion.

Travis seem to be on the path of happiness.

Hope you had a nice flight back @willingc BTW. Looking forward to have you here !

willingc reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@willingc
willingc merged commit 59b3863 into ipython:master Aug 23, 2016
@Carreau
Carreau deleted the update-no-2x branch August 23, 2016 19:35
@Carreau

Carreau commented Aug 23, 2016

Copy link
Copy Markdown
Member Author

Thanks !

willingc reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fperez

fperez commented Aug 23, 2016

Copy link
Copy Markdown
Member

Great, thx!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Carreau Carreau modified the milestone: 6.0 Sep 26, 2016
@nealmcb nealmcb mentioned this pull request Apr 11, 2017
Outreach re: ipython 6.0.0rc1 breaking builds of related projects on Python 2.7 #10438
Closed
@thomasballinger thomasballinger mentioned this pull request Jul 24, 2017
Correct suggested git commands for checkout 5.x #10713
Merged
@hugovk hugovk mentioned this pull request Oct 21, 2017
Remove redundant Python 2 code #10865
Merged
8 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

6.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Carreau @fperez @willingc
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.