I have confirmed and ran it on my local terminal but it will not recognize any commands in juypter notebook for some reason...
screenshot of error
First, please confirm that jupyter has been installed correctly.
pip3 install --upgrade pip
pip3 install jupyter
Find the installation location of jupyter
pip3 show jupyter
You will get a result similar to the following
According to location, we can find the location of jupyter
/Library/Frameworks/Python.framework/Versions/3.7/bin/
Then add this location to the path searched by the command. (Be careful not to add spaces on both sides of the equal sign when assigning)
vim ~/.zshrc (or .bashrc if bash)
Add the following statement
export PATH=/Library/Frameworks/Python.framework/Versions/3.7/bin/:$PATH
Then reload the relevant command
source.zshrc
Use jupyter
jupyter notebook
Hope this helps you
Related
I keep on getting error message:
Available subcommands: 1.0.0
Jupyter command `jupyter-nbconvert` not found.
I've tried to reinstall nbconvert using pip to no use. I've also tried the tip from this thread with installing pip install jupyter in vscode terminal but it shows that "Requirement already satisfied"
VSCode fails to export jupyter notebook to html
I've also tried to manually edit jupyter settings.json file to the following:
"python.pythonPath": "C:\\Users\\XYZ\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\Scripts"
I've python 3.9 installed via windows store.
Any tip on what might be the issue for vscode doesn't want to export the notebook?
pip uninstall nbconvert
run CMD as admin
pip install nbconvert
Following above steps resolved my issue. Got this solution from this thread
Unsure exactly what fixed the issue but heres a summary.
Updated to python 3.10
Installed pandoc and miktex
Powershell reinstall nbconvert
Received warning that nbconvert script file is installed in a location not in Path.
Copied said location to System Properties - Envionment Variables - Path
Restart and install all miktex package on the go
PDF export and HTML export seems to work as intended now.
Here's my step to convert .ipynb to html:
Install required module: pip install nbconvert
Turn to the folder that contains .ipynb then run jupyter nbconvert --to html Text.ipynb
You may create a new virtual environment to avoid messing up global one then try again.
For your reference: nbconvert-PyPI and create virtual environment.
Quick answer:
import pip
package= ['nbconvert'] # install any package you need without any error forever
for i in package:
pip.main(['install', i])
After facing a similar problem, I tried to resolve it. None of these solutions didn't resolve my problem.
But found an alternative approach, tried opening the notebook by the following command and succeeded.
python -m notebook
If a notebook was not installed in your system, then install it with pip
pip install notebook
After opening your notebook into Jupiter, export it into your desired file.
I use Pyhton3 and have very limited packages in python, this caused a problem for me.
pip install nbconvert
also try using
pip3 install nbconvert
I bought Macbook air M1, and I tried to install jupyter notebook with this code.
pip3 install --upgrade pip
pip3 install jupyter
and I tried to open jupyter notebook with this code.
jupyter notebook
but, then, this code appeared.
zsh: command not found: jupyter
enter image description here
First, you need to find where it was installed.
pip3 show jupyter | grep Location
Example:
$ pip3 show pip | grep Location
Location: /usr/lib/python3/dist-packages
Then you need to ensure that the path you get is in your PATH.
Example:
$ export PATH=/usr/lib/python3/dist-packages:$PATH
Try adding Python's bin/ folder path to $PATH variable.
You should be able to find it here - /Users/<your-username>/Library/Python/3.x/bin
Step 1 : Open .bash_profile in text editor
open ~/.bash_profile
Step 2 : Add the following line at the end of the file
export PATH="/Users/<your-username>/Library/Python/3.x/bin:$PATH"
Step 3 : Save the edits made to .bash_profile and restart the terminal
This issue and many others are bound to happen with Jupyter. There are many tools that install Jupyter and they all do it a bit differently.
To sidestep the whole problem of clunky installs, try a desktop "click and run" app for Jupyter.
For macOS and iOS, that's Callisto. It's currently in the beta stage so you can try it out for free (it even lets you connect to cloud servers for running your notebooks!)
For reference: This comment has a good solution for fixing pip3 install on macOS
Good luck!
I've hit a dead end trying to solve/debug this issue which doesn't seem like it should be that difficult.
I'm working in Pycharm IDE (not the professional) and I'm working inside a virtual environment let's call it pythonProject and I want to be able to run launch a jupyter notebook in this environment so that it can pick up all the python packages i've installed and configured for this environment.
As I understand it from the documentation, these are the steps I need to take.
My terminal prompt statement:
(pythonProject) oliver#oliver-u20:~/pythonProject$
commands:
python3 -m pip install ipykernel
python3 -m pip install notebook
python3 -m ipykernel install --user --name pythonProject --display-name "Python (pythonProject)"
jupyter notebook
But when I load jupyter notebook, it only shows python3 under kernels.
I tried outputting
jupyter kernelspec list
And get only the base kernel which suggests from this that it's not finding my kernelspec, but I can't seem to figure from the documentation what i'm supposed to do.
Am I missing something?
Ok so I've solved this.
I think there was an install issue with jupyter.
I tried reproducing this in a completely new project and venv and could get the kernel showing.
In the project and venv where I still couldn't, I noticed a discrepancy in the output of my jupyter --paths
In the working venv I could see under data
/home/oliver/.local/share/jupyter
Which is where the kernels I installed are located.
However in the project that wasn't working there was instead:
/home/oliver/snap/jupyter/6/.local/share/jupyter
I'm guessing this snap path is from how I originally installed jupyter on my Ubuntu via the app store - seemed sensible at the time.
So I uninstalled jupyter, restarted my venv and the jupyter --paths has magically changed so that
/home/oliver/.local/share/jupyter
is present and when I start a jupyter notebook at the command line with
jupyter notebook
I can see all my kernels showing!
I found this quite difficult to debug with the documentation and command help outputs so hope someone else finds this useful.
I just updated my macOS to Catalina and I can't run python or open a jupyter notebook from terminal anymore. As an example, I get error message "ImportError: No module named pandas" when running my python code, and I get
zsh: command not found: jupyter
when running
jupyter notebook
This issue has brought me to anaconda (I would love someone to explain me why. Does python need anaconda to be ran?). I have tried several suggestions from https://github.com/ContinuumIO/anaconda-issues/issues/10998, e.g. I have tried copying folder "anaconda3" from "Relocated items" folder to "Users//", then
export PATH=''/Users/<username>/anaconda3/bin:$PATH"
but I get either
dquote>
or
zsh: /Users//Applications/anaconda3/bin/conda: bad interpreter: /anaconda3/bin/python: no such file or directory
I then tried to reinstall Anaconda using the graphic installer (from https://www.anaconda.com/distribution/#macos) following advice from someone from the anaconda team (https://www.anaconda.com/how-to-restore-anaconda-after-macos-catalina-update/) (I changed installation location to a folder I created in /Users//) but I still get the same error messages when running python3 or jupyter notebook.
How can successfully run python and jupyter notebook with macOS Catalina?
After installed macOS Catalina, we can switch the terminal from bash to zsh. There are many advantages from using zsh instead of bash, but One of the issues with zsh is some of the frameworks (jupyter notebook,conda) are not supported directly. Once I typed jupyter notebook in terminal to run it. It displayed “zsh: no such file or directory”.
The solver is simple but very difficult to find online.
If jupyter was already installed before the update and stopped working after zsh, you should be able to fix it by:
1.open zshrc in terminal by typing: open .zshrc or $open .zschrc
2. add the following line at the end of the file:
source ~/.bash_profile
It will ask zsh to use all the information from bash like the path of jupyter.
Hope it can help you out!
I'm answering to my own question in case it can help others ;)
I found my answer here: https://medium.com/#singhaniatanay18/mac-os-catalina-update-zsh-instead-of-bash-d688f68f70b8
(see comments as well)
Mac OS BigSur:
Uninstall Anaconda:rm -f Anaconda-Navigator.app
re-install pip3 install jupyterlab
I just updated to Catalina, two days before Big Sur release.. oh well.
Catalina came with changes to security and bash, that will remain for future releases. So Catalina moves your anaconda3 folder to /Users/Shared/Previously Relocated Items/Security/anaconda3 I tried to move it back to home directory, but that didn't work. So I deleted it, and reinstalled Anaconda using the command line installer Not the GUI installer, and it worked for me. You can follow instructions here and use /Users/me/anaconda3 folder as recommended here.
Here are the commands that worked for me,
shasum -a 256 /Users/username/anaconda3 . Although not sure it did anything
bash ~/Downloads/Anaconda3-2020.02-MacOSX-x86_64.sh or whatever the name of the command line installer from Conda in your Download folder, or wherever else you downloaded it.
Use sudo in front of the command if permission was denied, then enter your log in password for your Mac
source /Users/username/anaconda3/bin/activate conda init zsh
sudo conda init zsh then enter your Mac's password.
You should be all set now, and all commands like ipython, conda info, jupyter notebook, pyspark will all work.
The last command will make step3 command persist i.e. initialize conda base environment, such that you can run conda, ipython, jupyter notebook the next time you use terminal.
Install the Jupyter using Homebrew in zsh shell
If you don't Python install 3.3or higher.
Open terminal
Using Homewbrew install jupyter
brew install jupyter
Now, you start a notebook
jupyter notebook
I have installed anaconda on my MAC laptop, and tried to run jupyter notebook to install it, but I get error jupyter command not found.
You need to activate your conda environment (source bin/activate) and then do
$ pip install jupyter # Alternatively, you can do `conda install jupyter`
$ jupyter notebook # to actually run the notebook server
Add $HOME/anaconda3/bin to your $PATH and jupyter-notebook should work. There are a ton of other binaries you can lookup in that folder as well.
export PATH=$HOME/anaconda3/bin:$PATH
then
jupyter-notebook
#ffledgling anwser did not work for me. What did solve was to install jupyter using conda:
conda install jupyter
That did the trick. Right after the installation finished I went with
jupyter notebook
as my next command and saw the server setup and the browser page opening.
I had this same problem on my Mac OS. I'm also new to Python, so forgive me if this is an obvious solution.
What solved it for me was installing Python with the 'install for me only' option rather than the hard-drive option. If it tells you you can't, then reselect it. After that, the command jupyter notebook opened without a problem.
Hope it can help someone!
How to
It could be as simple as opening a new Terminal window.
For Windows
After you can successfully run conda from powershell, you can install jupyter with: conda install jupyter command. Then re-open powershell and run conda run jupyter notebook.
If your issue is happening after running conda install jupyter, you can use conda init zsh to configure the ~/.zshrc automatically so that when you just type jupyter notebook on terminal, it can find it.
I ran into the same problem try this instead
jupyter-notebook
I had the same issue on Mac. I am using Miniconda
Opened ~/.zshrc profile on nano as, nano ~/.zshrc
and added the location of miniconda on my mac as the last line of the ~/.zshrc as:
export PATH="/usr/local/Caskroom/miniconda/base/bin:$PATH"
solves the issue easily.
Open a new terminal and try again, it worked for me. This is written somewhere in the installation guide "For this change to become active, you have to open a new terminal."
If it's a fresh installation. Close the the terminal and re-open
You don't have to install jupyter explicitly. Anaconda does for you.
Ensure the environment is activated first.
If you selected Yes when prompted "Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no]" during installation, prepend your commands with conda
mycomp#55:~$ conda activate
(base) mycomp#55:~$ jupyter notebook
After installing Anaconda on windows 10, you can use Anaconda prompt from start menu to activate a conda enabled terminal window.
You can run Jupyter from that window using:
jupyter notebook
You should first have conda in your PATH environment. You can achieve it taking a look on this answer.
Now you just need to run jupyter notebook.