I created a Python project in PyCharm, new some jupyter notebooks, and then connect to a remote Jupyter server, it works good.
I see the notebooks stored in my local machine,
So when I want to use %run ./another_notebook.ipynb
or import custom_python_file.py,
ModuleNotFoundError occurred.
How can I call or import another file in this situation? Only upload the file to Server?
Related
When I start a jupyter notebook, I am able to start a terminal prompt running on the host machine with "New > Terminal".
Is it possible to connect to this terminal with, for instance, iTerm, instead of using the web interface?
How does jupyter connect to the remote terminal?
Note: I am using a remote Jupyter notebook with several port forwarding. I am not able to directly open a terminal onto this machine.
I can connect to a remote Jupyter Notebook server with a token from VSCode through the "Python: Specify Jupyter server URI" command from the Command Palette.
However, I didn't find a way to do 2 things:
Open an existing Notebook on the remote Jupyter Notebook server.
Specify a folder to connect to, where my existing notebook resides in the remote server.
Is there a way of doing it?
Currently, VSCode doesn't support this functionality. See this issue: https://github.com/microsoft/vscode-python/issues/8161
I'm running a notebook on a remote server, to which I connect from my local machine via browser. One slight annoyance I have is it prints this on start:
Serving notebooks from local directory: /home/xxxxxxx
0 active kernels
The Jupyter Notebook is running at:
http://(friendly or 127.0.0.1):8888/
Where friendly is the friendly name of the host. The FQDN of the host is actually friendly.x.y.z.com. I would like it to print this:
The Jupyter Notebook is running at:
http://friendly.x.y.z.com:8888/
so that the URL is directly clickable from the console. Is there a config option I can pass somewhere to do that in jupyter notebook to explicitly specify the hostname I want displayed?
To be clear, http://friendly.x.y.z.com:8888/ resolves correctly in the browser despite the above message.
You should first generate the config file:
jupyter notebook --generate-config
Then using the config file you can set the custom URL by editing the config file ~/.jupyter/jupyter_notebook_config.py changing the following line:
c.NotebookApp.custom_display_url = 'http://friendly.x.y.z.com:8888'
So when you start the server it will show this URL concatenated with the token.
D:\Python\python.exe "D:\PyCharm 2018.2.1\helpers\pycharm\pycharm_load_entry_point.py" notebook --no-browser --ip 127.0.0.1 --port 8886 --port-retries=0
[TerminalIPythonApp] WARNING | Subcommand `ipython notebook` is deprecated and will be removed in future versions.
[TerminalIPythonApp] WARNING | You likely want to use `jupyter notebook` in the future
[W 17:58:52.576 NotebookApp] Terminals not available (error was No module named 'winpty.cywinpty')
[I 17:58:52.579 NotebookApp] Serving notebooks from local directory: D:\Python projects\Projects
[I 17:58:52.579 NotebookApp] The Jupyter Notebook is running at:
Whenever I run a x.ipynb file it returns the error msg above, i can only access jupyter in browser.
How can I run it within pycharm??
You can use PyCharm as an IDE alternative for editing Jupyter notebooks in a browser, but it won't run a notebook server for you automatically. You can simply open *.ipynb file in PyCharm and it opens with a dedicated notebook editor. When you run a cell for the first time, it is going to ask you about the url of a running notebook, like http://localhost:8888/?token=<token>
You can get this url by running the following in a console:
jupyter notebook list
Running a notebook server is a separate thing. You can do it externally or use a built in 'Jupyer Notebook' run template (via 'Run...' menu'). When you start a server from inside PyCharm this way, you will get your notebook url in a run console.
I have just started learning spark and have been using R & Python on Jupyter notebook in my company.
All spark and Jupyter are installed on my computer locally and function perfectly fine individually.
Instead of creating .py script for pyspark in cmd every single time, could I possibly connect it to my Jupyter notebook live and run the scripts there? I have seen many posts on how to achieve that on Linux and Mac but sadly I will have to stick with Window 7 at this case.
Thanks!
Will
You could use the Sandbox from Hortonworks (http://hortonworks.com/downloads/#sandbox) and run your code in Apache Zeppelin.
No setup necessary. Install virtual box and run the sandbox. Then access zeppelin and ambari via your host (windows) browser and you are good to go to run your %pyspark code. Zeppelin has a look an feel like Jupyter.