-bash: jupyter: command not found - python

I installed a copy of Anaconda to play around with, but decided I liked Homebrew better, so I removed it. However, this seems to have messed up my install of Jupyter Notebooks, as I can no longer access it. I reinstalled it with pip install jupyter and when I run pip show jupyter I get:
Version: 1.0.0
Summary: Jupyter metapackage. Install all the Jupyter components in one go.
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: jupyter#googlegroups.org
License: BSD
Location: /usr/local/lib/python2.7/site-packages
Requires: ipywidgets, nbconvert, notebook, jupyter-console, qtconsole, ipykernel
But when I run which -a jupyter I get nothing. I even tried uninstalling and installing python again via Homebrew and it still gives me the error, -bash: jupyter: command not found.
I have python installed correctly, which -a python gives:
/usr/local/bin/python
/usr/bin/python
Any ideas as to why it might not be working?

I'm on Mac and am using Zsh. For some reason, after I installed Python3, the following line:
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
was added to .zprofile instead of .zshrc.
I transferred the line to .zshrc and did source ~/.zshrc. That did the trick.

The below command seems to install only python files (under /usr/local/lib/python2.7/site-packages in your case):
pip install jupyter
You can run the jupyter as a Python's module like this:
python -m jupyter
To see all installed modules you can type the following command from the Python's shell:
help('modules')
As an alternative you can try to upgrade the package:
pip install --upgrade pip
pip install --upgrade jupyter
If you want to access the jupyter by simply typing jupyter in your shell then the path to the jupyter's binary file should be placed inside the PATH variable.
During the installation of Anaconda software the jupyter binary is placed under /usr/local/bin/jupyter (Ubuntu 14.04).

On Mac OS Mojave,
pip3 install jupyter
installs jupyter under
/Library/Frameworks/Python.framework/Versions/3.5/bin/
. Your version may be different from 3.5. You can then link to the binary there as follows.
ln -s /Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter /usr/local/bin/
In the rare case that /usr/local/bin/ is not on your PATH, you may replace it above with some folder that is.

python -m notebook
should do the trick

Related

Can't install Jupyter Notebook using Windows PowerShell because pip won't upgrade to version 20.1

I'm following this video to install Jupyter Notebook using Windows PowerShell. I entered the scripts folder and type .\pip install jupyter, and then it suggested uploading pip to version 20.1 first. Well, I typed python -m pip install --upgrade pip as suggested, but nothing happened. If I tried to install Jupyter Notebook again, it would just start a circle once again.
Things I have tried but don't work:
.\pip3 install jupyter as some other thread online says
doing all these in the Python folder (one level up)
python -m pip install -U pip, as suggested by the official webpage of installing pip
add Path to Windows as instructed by this blog
Why does this happen? Isn't what I get when installing Python 3.8 the lastest version of pip? How can I actually upload it to version 20.1 now?
BTW, this is what my Scripts directory looks like now:
After you change the Path variable and before you start python -m pip install -U pip you have to start a new shell.
It's because the Path you setup is not taken dynamicaly.

How do you completely uninstall jupyter notebook and jupyterlab from a mac when standard uninstall commands have no effect?

This has been asked many times - but I cannot for the life of me get rid of jupyter notebook/jupyterlab. I want to not be able to run a jupyter notebebook so that I can re-install everything.
I have tried the simple
pip uninstall jupyterlab pip uninstall notebook pip uninstall jupyter also with pip3 options
I have tried
$ pip3 install pip-autoremove
$ pip-autoremove jupyter -y
and changed pip3 for pip in case that made a difference.
I have followed what has been suggested with this answer
The output to which jupyter is /usr/local/bin/jupyter. I tried sudo /usr/local/bin/python -m pip uninstall jupyter following the comment answer this question.
Whenever I try remove it I just get Skipping jupyter as it is not installed. errors, yet if you run jupyter notebook it runs, and which jupyter continues to return a result.
It was suggested that I re-install Python3, but Jupyter Notebook is running Python2 (on a mac, so can't get rid of that), and I can't uninstall Python3 either following any instructions I can find.
Is there any way to get rid of this program from a mac when all the above fail to do anything?
Far as I know it was installed with pip, but I also checked if it was installed through conda (conda not recognised as a command)
I am running macOS Mojave Version 10.14.6. Python versions are
$ python --version
Python 2.7.15
$ python3 --version
Python 3.6.5

jupyter notebook installation issue using pip

I had a problem with jupyter notebook. Every time I started a notebook, kernel died.
So, I decided to uninstall jupyter notebook using pip:
pip uninstall jupyter notebook
After successful uninstallation, I installed again, using same pip:
pip install jupyter notebook
Then, as usually, I typed in cmd:
jupyter notebook
But got this error:
'jupyter' is not recognized as an internal or external command,
operable program or batch file.
So I checked the location of IPython, and found out that now the right file, which I want to call is jupyter-notebook, which different from jupyter notebook by dash sign. If I run jupyter-notebook from cmd everything works.
Can anyone explain, what happened and why the file now called jupyter-notebook?
Thank You
Because pip uses the legacy Python 2.
Use pip3 to install:
pip3 install --upgrade pip
pip3 install jupyter
jupyter notebook #to start jupyter notebook
I highly recommend installing Anaconda.
Download Anaconda here.
Then use :
bash
to install it.
Good Luck.
A solution without installing Anaconda, or conda:
sudo easy_install pip==20.3.4
pip2 install virtualenv
virtualenv jupyter
source jupyter/bin/activate
pip2 install jupyter
jupyter notebook
This solution was tested on:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
It was run on 32bit Chromenotebook, with Firefox vs NetSurf installed on xenial
Jupyter notebook will be open automatically. However, everytime loging in on Jupiter again, at first source needs to be activated:
source jupyter/bin/activate
and then:
jupyter notebook
to start
I recommend that you always use conda instead of pip to install the Jupyter Notebook.
In your case, for example, I will recommend:
conda install jupyter notebook
and not pip install jupyter notebook I can see that most of the problems that you described there are environment related and hence you can often run into environment issues while using pip to install jupyter

Matlab kernel in Jupyter [duplicate]

When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred.
Error executing Jupyter command 'notebook': [Errno 2] No such file or directory
My Python version is 3.6, and my Jupyter version is 4.3.0
How can I resolve this issue?
It seems to me as though the installation has messed up somehow. Try running:
# For Python 2
pip install --upgrade --force-reinstall --no-cache-dir jupyter
# For Python 3
pip3 install --upgrade --force-reinstall --no-cache-dir jupyter
This should reinstall everything from PyPi. This should solve the problem as I think running pip install "ipython[notebook]" messed things up.
For me the issue was that the command jupyter notebook changed to jupyter-notebook after installation.
If that doesn't work, try python -m notebook, and if it opens, close it, then
export PATH=$PATH:~/.local/bin/, then refresh your path by opening a new terminal, and try jupyter notebook again.
And finally, if that doesn't work, take a look at vim /usr/local/bin/jupyter-notebook, vim /usr/local/bin/jupyter, vim /usr/local/bin/jupyter-lab (if you have JupyterLab) and edit the #!python version at the top of the file to match the version of python you are trying to use. As an example, I installed Python 3.8.2 on my mac, but those files still had the path to the 3.6 version, so I edited it to #!/Library/Frameworks/Python.framework/Versions/3.8/bin/python3
Try this command: python -m IPython notebook
Credits to the GitHub user Milannju who provided the solution here.
This worked for me. (Python 3.6 on Ubuntu 18.04 LTS)
export PATH=$PATH:~/.local/bin/
On Ubuntu 18.10, the following command helped me out.
sudo apt-get install jupyter-notebook
Jupyter installation is not working on Mac Os
To run the jupyter notebook:-> python -m notebook
Use the command below and if you are using pip3 replace pip by pip3
pip install --upgrade --force-reinstall jupyter
This worked for me.
Since both pip and pip3.6 was installed and
pip install --upgrade --force-reinstall jupyter
was failing, so I used
pip3.6 install --upgrade --force-reinstall jupyter
and it worked for me.
Running jupyter notebook also worked after this installation.
Deactivate your virtual environment if you are currently in;
Run following commands:
python -m pip install jupyter
jupyter notebook
For me the fix was simply running pip install notebook
Somehow the original Jupiter install got borked along the way.
I'm trying to get this going on VirtualBox on Ubuntu. Finally on some other post it said to try jupyter-notebook. I tried this and it told me to do sudo apt-get jupyter-notebook and that installed a bunch of stuff. Now if I type command jupyter-notebook, it works.
If you are on Fedora installing python3-notebook resolved my problem.
# dnf install python3-notebook

How to uninstall python jupyter correctly?

I have jupyter installed with python3.5 on my Mac OSX, but I want the python2.7 version. So, I basically need to uninstall the 3.5 version, and reinstall the 2.7 version.
But for some reason I can't uninstall the 3.5 version. I tried sudo python3 -m pip uninstall jupyter, and you can see the results below:
✔ ~/current/directory
20:08 $ which jupyter
/Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter
✔ ~/current/directory
20:08 $ sudo python3 -m pip uninstall jupyter
The directory '/Users/<username>/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Cannot uninstall requirement jupyter, not installed
The directory '/Users/<username>/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
✘-1 ~/current/directory
20:09 $ which jupyter
/Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter
...as you can see above, the which jupyter command still returns a valid path, AND not only that. I'm still able to launch jupyter notebook from the command line, and it opens a notebook.
How do I correctly get rid of my existing version of jupyter ? OR, if someone knows how to ADD a python2 kernel to my existing jupyter, that would be fine too. Is that possible?
All I can think of is to manually kill the files and subfolders inside of /Library/Frameworks/Python.framework/Versions/3.5/bin/, but this seems unnecessarily brutal?
The answer over here solved my problem: https://stackoverflow.com/a/42277762/8057434
I'll just summarize what to do.
Run
conda uninstall notebook nbconvert nbformat ipykernel ipywidgets qtconsole traitlets tornado jupyter_* ipython_genutils jinja2 -y
in your terminal.
You can use pip uninstall instead of conda uninstall if you aren't using anaconda.
From your home folder, delete ~/AnacondaProjects. After that remove the export of Anaconda environment variable from your bash profile ~/.bashrc .
Use pip3 instead of pip
pip3 uninstall jupyter
You can install for both python 2 and python 3 on the same computer as long as you use the correct pip version
I have jupyter installed with python3.5 on my Mac OSX, but I want the python2.7 version.
Anaconda is a great way to install python software that you need for specific projects.
Download from https://www.continuum.io/downloads#macos
as said, bash Anaconda2-4.3.1-MacOSX-x86_64.sh (the 2.7 version in your case)
go to the installed directory and type source bin/activate
This creates a command-line environment which has just the right level of libraries etc. Inside, you can install further data with f.ex. conda install numpy. To fix a version, use conda install numpy=1.10.
You should uninstall the jupyter-core, jupyter-console, jupyter-client seperately. After remove them all, these is no package found named jupyter.

Categories