Is it possible to run the Jupyter Notebook environment without creating a new .ipynb file? I often find myself in need of quick data inspection and feel like creating a new notebook would not be necessary but the perks of the notebook environment would be very appreciated because some operations might turn out to be quite bothersome using only the Python terminal interpreter.
Related
Context: I'm using vscode with WSL and I also use conda for environment management.
I'm trying to create a variable in a jupyter notebook, let's say x = [10, 20], and then use that same variable in a .py file (not on jupyter notebooks). I'm already using the same environment on both, but the terminal/kernel I believe is different for each. I believe this because when I run a cell on jupyter notebook, nothing happens on the terminal. However, when I run on .py files, the terminal runs the code I selected.
I would like to see the terminal running something for jupyter (.ipynb) and also for my .py files.
Any help would be really appreciated.
macOS v. 11.2.3.
2 versions of python installed
/opt/homebrew/bin/python3
/usr/bin/python3
I created a virtual environment (venv) to work with a jupyter notebook, but every time I open a document in a VSCode, I see 2 servers start up at the same time and the last one that is selected is not the one that is in the virtual environment:
Moreover, every time I open a document, I have several files in the trash with something like this name:
chunks-3a679475-8ceb-44eb-9ac3-fcefe0595bc1.ipynb
How can i fix this?
In VS Code, it is normal that the python environments of the two are different. The python kernel used by Jupyter Notebook can be independent of the python environment selected in the lower left corner of VS Code, and usually it is the python environment used by VS Code by default. If the python extension has not been loaded yet, Jupyter uses the last python environment by default.
Please click on the location of the python kernel displayed on the upper right of Jupyter, and select the one you need from the expanded options. In addition, please try to reload VS Code.
Reference: Working with Jupyter Notebooks in Visual Studio Code.
Is there a way to deploy Jupyter Notebooks on Travis CI and test running all the cells?
My Jupyter Notebooks use IPython Kernel, and I have a conda environment file.
I've been wondering something similar and have compiled some information but haven't fully tested it yet.
Firstly, you can rely on jupyter nbconvert execute notebooks, where you can then look for errors. There's an example set up with Travis CI and Conda at ghego/travis_anaconda_jupyter. I believe Travis CI relies on pytest too to catch issues, though I'm not entirely sure how this fits together.
Another way you can run this is with pytest-notebook, which relies on you having a working version of the notebooks you want in some environment. This package's main purpose is to detect if changes to the environment will create issues within the notebooks. This can also potentially be used in conjunction with the above method, though it might be redundant.
It might be additionally beneficial for version management (tracking, seeing diffs, legibility) to write your notebooks in markdown format and then use jupytext to convert them into a .ipynb file to then run with the above options. jupytext can also execute notebooks directly with the --execute flag, so perhaps there's an even simpler way to integrate such a workflow!
I will be testing this in the coming weeks and will update this comment if I learn anything new.
I'm trying to run a downloaded jupyter notebook from https://github.com/justmarkham/scikit-learn-videos with pycharm 16.1 on win7. I've come across https://www.jetbrains.com/help/pycharm/2016.1/tutorial-using-ipython-jupyter-notebook-with-pycharm.html , but this appears to deal with creating a notebook from scratch. Following the directions, I have created a virtualenv 'ml' with scikit learn and the needed depedencies including the jupyter notebook. As you can see, the main project run button is greyed out. Do I need to create a configuration file for this, i.e.
How can I get this working?
I have a .py file shared with other colleagues that we are modifying almost in parallel. I would like to modify it with ipython notebook. Notebook opens it correctly and even interpret it with colors. Nevertheless, it does not auto complete when I'm programming.
I wonder whether is possible to activate the autocomplete on .py in notebook.
Thanks.