Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve error reporting when wrong python runs #2723

Closed
yz5548 opened this issue Oct 14, 2015 · 7 comments
Closed

improve error reporting when wrong python runs #2723

yz5548 opened this issue Oct 14, 2015 · 7 comments

Comments

@yz5548
Copy link

yz5548 commented Oct 14, 2015

Problem: when open a default worksheet with ipython and R, there is error popup "error no module named 'urllib2' "

BTW: looks like ipython is still working by typing "1+1", "1*6+7"

Environment:
OS: Win 7 64 bit
browser: google chorme
notebook version: 1.4.1-0-ge8427bf-windows

Log information
D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM Copyrigh
t 2014 TWO SIGMA OPEN SOURCE, LLC

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM Licensed
under the Apache License, Version 2.0 (the "License");

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM you may
not use this file except in compliance with the License.

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM You may
obtain a copy of the License at

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM h
ttp://www.apache.org/licenses/LICENSE-2.0

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM Unless r
equired by applicable law or agreed to in writing, software

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM distribu
ted under the License is distributed on an "AS IS" BASIS,

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM See the
License for the specific language governing permissions and

D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows>REM limitati
ons under the License.
Port range 8800-8803 taken, searching...
Oct 14, 2015 1:58:11 PM com.twosigma.beaker.shared.module.util.GeneralUtilsImpl
readFile
INFO: ERROR reading file C:\Users\H141930.beaker\v1\config\beaker.pref.json
starting nginx instance (D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge84
27bf-windows/nginx)
[main] INFO org.eclipse.jetty.server.Server - jetty-8.1.13.v20130916
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started SelectChannelCo
nnector@127.0.0.1:8806

Connecting to http://127.0.0.1:8805/

Running
0: D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows\python\py
thon
1: D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows/config/pl
ugins/eval/ipythonPlugins/ipython/ipythonPlugin
2: 8808
Done starting IPython
Running
0: D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows\python\py
thon
1: D:\Software\BeakerNotebook\beaker-notebook-1.4.1-0-ge8427bf-windows/config/pl
ugins/eval/r/rPlugin
2: 8809
Done starting R

@scottdraves
Copy link
Contributor

Thanks for the report.
Beaker is confused between Python2 and Python3.
How did you install IPython?

@yz5548
Copy link
Author

yz5548 commented Oct 15, 2015

using ANACONDA PYTHON 3.4 Windows 64-bit

https://www.continuum.io/downloads

@scottdraves
Copy link
Contributor

Thank you. What happens if you restart beaker, make a a new empty notebook, open the language manager, and then click on Python3?
Does it turn green, stay yellow forever, or produce an error?

@yz5548
Copy link
Author

yz5548 commented Oct 15, 2015

Python3 is OK ( it turn green without any error msg). Ipython still have the error for the first time

@scottdraves
Copy link
Contributor

Thanks again. I think the problem is Beaker assumes you install Python2 Anaconda, and then add Python3 in a virtualenv. Will have to think about how best to fix that, but in the meantime you should be good as long as you avoid the "IPython" (aka Python2) plugin.

Unfortunately most of the Python tutorials are written assuming Python2 :( So to run those tutorials you would need to change the language of each cell and also make any code changes required. Or you can just make new Python3 notebooks and copy and paste in code from Python2 tutorials.

Or you could uninstall anaconda & install 2&3 as Beaker expects, then everything should just work :)

Beaker should probably update our tutorials, it is time to switch the "default" to 3. This is a new issue.

Beaker should probably base our python plugins on jupyter protocols to get list of available languages. there is already an issue for this.

@scottdraves
Copy link
Contributor

After a bit more research, I decided we should keep our default that users will install Python2 primarily, and Python3 as an option, and keep our documentation in Python2.

So the more complex issue of handling more exactly which Pythons and other languages are available to jupyter remains in issue 1731.

the thing i can change now to make this a better UX is to improve the error when users try to start python2 and get python3, we can detect this and report a nice error and point at the documentation instead of crashing.

@scottdraves scottdraves added this to the v1.4 milestone Oct 19, 2015
@scottdraves scottdraves changed the title error no module named 'urllib2' improve error reporting when wrong python runs Oct 19, 2015
@yz5548
Copy link
Author

yz5548 commented Oct 19, 2015

Thank you very much for the update

scottdraves added a commit that referenced this issue Oct 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants