takluyver / nbopen

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

No module named 'notebook' #40

Closed zezhong-zhang closed 7 years ago

zezhong-zhang commented 7 years ago

Hello,

I have installed Jupyter with conda and now trying to install nbopen on my mac. I can open ipython notebook using the command line. However, there is trouble to integrate with the file manager using

./osx-install.sh Following are the errors:

generating .icns file for mac app... NOTE: this will produce one warning message, because there is no 1024x1024 icon that could be used to for the 'retina' 512x512 icon Traceback (most recent call last): File "py2app_setup.py", line 5, in import nbopen File "/Users/nbopen/nbopen/init.py", line 5, in from .nbopen import main File "/Users/nbopen/nbopen/nbopen.py", line 7, in from notebook import notebookapp ImportError: No module named 'notebook'

takluyver commented 7 years ago

I guess that the notebook is installed in a different Python to the one you're trying to install nbopen. Running which python3 will show you the Python it will try to install into. You can change that by editing osx-install.sh before you run it.

zezhong-zhang commented 7 years ago

Indeed, it is different python. I have passed the installation with the miniconda python3. However, there is an error message when I run the nbopen application.

A Python runtime not could be located. You may need to install a framework build of Python, or edit the PyRuntimeLocations array in this application's Info.plist file.

Thanks a lot for your help!

takluyver commented 7 years ago

Sorry, that's Mac-specific stuff that I can't help with. @artwr, who added the OSX integration, might have an idea.

zezhong-zhang commented 7 years ago

Now I have resolved the problem by using mac's automator. The code is attached below for anyone who just wants to access ipython notebook via double click. The code is modified from the solution of opening code in vim from finder.

`on run {input, parameters}

set filename to POSIX path of input

set cmd to "clear;cd dirname " & filename & ";jupyter notebook " & filename

tell application "iTerm"

tell the current window

create tab with default profile

tell the current session

write text cmd

end tell

end tell

end tell

end run`