takluyver / nbopen

Open a Jupyter notebook in the best available server
BSD 3-Clause "New" or "Revised" License
301 stars 58 forks source link

Add Python 2 compatibility #2

Closed stefanv closed 10 years ago

hughesadam87 commented 10 years ago

Came here looking for this. Just wanted to add that on python 2.7 I get this error in the function that this pull request mentions. Going to post the traceback here for reference:

glue@glue-desktop:~/Downloads$ nbopen Contour_Outline.ipynb 
Traceback (most recent call last):
  File "/home/glue/Enthought/Canopy_64bit/User/bin/nbopen", line 3, in <module>
    main()
  File "/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/nbopen.py", line 46, in main
    nbopen(args.filename, args.profile)
  File "/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/nbopen.py", line 23, in nbopen
    server_inf = find_best_server(filename, profile)
  File "/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/nbopen.py", line 16, in find_best_server
    default=None)
TypeError: max() got an unexpected keyword argument
dkirkby commented 7 years ago

The following lines in osx-install.sh will not work unless python3 is correctly configured (e.g., within an anaconda 2.7 environment):

python3 setup.py install
python3 setup.py py2app

Any reason not to replace python3 with python here?

takluyver commented 7 years ago

Feel free to make a PR. The Mac specific stuff is very contributor-driven, because I don't use a Mac.