I'm on macOS Big Sur, running python3.9 installed with homebrew. I had some path link problem with my old jupyter so I uninstalled it. I couldn't remember how I installed the jupyter in the past so I manually rm jupyter files in /usr/local/bin and /usr/local/Cellar.
Then I reinstalled jupyter-lab using pip3 install. Then when I run jupyter lab, it gave me traceback:
File "/usr/local/bin/jupyter", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/jupyter_core/command.py", line 285, in main
command = _jupyter_abspath(subcommand)
File "/usr/local/lib/python3.9/site-packages/jupyter_core/command.py", line 124, in _jupyter_abspath
raise Exception(
Exception: Jupyter command `jupyter-lab` not found.
However, I've checked the jupyter notebook command. It worked fine. It seems I'm only missing the jupyter-lab file. What should I do?
Did you add /.local/bin to the environment path?
export PATH=$PATH:~/.local/bin
Related
After installing Anaconda and jupyterlab, the command jupyter lab on default Ubuntu terminal launches Jupyter Lab on a browser flawlessly. After installing Oh My Zsh, I experienced the following problems. Probably a simple fix but I can't seem to find a solution for Ubuntu 16.
Jupyter notebook seems to work fine but Jupyter lab does not work.
❯ jupyter lab
Error executing Jupyter command 'lab': [Errno 2] No such file or directory
Anaconda is also not working.
❯ conda --version
zsh: command not found: conda
I'm worried that something else is not working as well. A general fix will be more helpful.
Thank you very much.
In your '.zhrc' file try adding a line to source the '.bash_profile'.
Steps:
In terminal, enter vim ~/.zshrc
Add source ~/.bash_profile into .zshrc file
Finally in terminal, enter source ~/.zshrc
I've recently installed Anaconda3 32bit version on Windows 10 but Jupyter won't launch.
I've updated anaconda using conda and everything looked ok with all packages including Jupyter downloading.
I've added the path to environmental variables.
I've tried to run jupyter notebook from cmd prompt but still get the same error message.
Trace:
Traceback (most recent call last): File "C:\Users\Edward\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
ModuleNotFoundError: No module named 'notebook.notebookapp'; 'notebook' is not a package
If jupyter is installed on your system you can also use cmd to open i as:
jupyter notebook
If not then u can use pip to install jupyter:
pip install jupyterlab
or
pip install notebook
Then you can use cmd to open.
Maybe you did not download the latest version of Python.
Try downloading Python 3.9 first and see.
You can also download jupyter notebook from your OS terminal.
Thanks, but I have tried these ideas. The root of the problem (pun not intended!) is in the path definitions I think. I have tried adding path definitions. But things that used to work fine like running pip from the C:\ prompt no longer do. So I have given up on Anaconda and now use Visual Studio Code for everything, including running a Jupyter Notebook.
Don't know why the system path definition doesn't work. If I go to the directory containing pip it runs ok.
Many Thanks
I just installed Anaconda, in my Surface Pro 3, with Windows 10, using the provided installer for 64-bit. When I try to launch "jupyter notebook" I always get the following message:
Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation.
All rights reserved.
C:\Users\Carlos>jupyter notebook Traceback (most recent call last):
File "C:\Program
Files\Anaconda3\Scripts\jupyter-notebook-script.py", line 3, in
import notebook.notebookapp
File "C:\Program
Files\Anaconda3\lib\site-packages\notebook\notebookapp.py", l ine 32,
in
from zmq.eventloop import ioloop
File "C:\Program Files\Anaconda3\lib\site-packages\zmq__init__.py",
line 34, in
from zmq import backend
File "C:\Program
Files\Anaconda3\lib\site-packages\zmq\backend__init__.py", l ine 40,
in
reraise(*exc_info)
File "C:\Program
Files\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", lin e 34, in
reraise
raise value
File "C:\Program
Files\Anaconda3\lib\site-packages\zmq\backend__init__.py", l ine 27,
in
_ns = select_backend(first)
File "C:\Program
Files\Anaconda3\lib\site-packages\zmq\backend\select.py", lin e 26, in
select_backend
mod = import(name, fromlist=public_api)
File "C:\Program
Files\Anaconda3\lib\site-packages\zmq\backend\cython__init__ .py",
line 6, in
from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.
I tried to uninstall/install again several times, I tried to install it just for me or for all the users in the computer, I tried to update anaconda first...with no success. Any clue?
Thanks!
It seems to be a problem with the default installation of Anaconda. So, I removed the pyzmq package, which seems to be the problematic one.
This is what I have done:
conda uninstall pyzmq (This also removes jupyter related packages!)
conda install pyzmq (to reinstall it)
conda install jupyter (to reinstall jupyter related packages)
Now I can open Jupyter Notebook!
I also got somewhat same error today on my system and now it got resolved by following solution.
Please add following in the path variable, it will be resolved thereafter (I just checked):
C:\ML\installed_tools\anaconda3 (was already present)
C:\ML\installed_tools\anaconda3\Scripts (was already present)
C:\ML\installed_tools\anaconda3\Library\bin (added now)
C:\ML\installed_tools\anaconda3\Library\mingw-w64\bin (added now)
Refer this link for exact exception which I got (with exact versions of the modules) and resolved thereafter. Above exception might be of older anaconda version but solution should be same.
Here is what worked for me (You have to upgrade pyzmq):
python -m pip install --upgrade pip
pip install --upgrade pyzmq
After that it worked fine.
There are multiple options to fix this, i am still investigating on the root cause. However, you can try the solution given below..
if the Jupyter notebook version is 5.1.0 & above, you can uninstall using << conda uninstall notebook >> and then install Jupyter notebook from Anaconda Command prompt using << conda install notebook=5.0.0 >> This will help you launch the Anaconda Navigator from base environment itself.
Second option..,
Create another environment in conda << conda env create -f {name of yml file}.yml >>.
After creating, open the Anaconda navigator UI, switch the environment to the newly created environment and launch Jupyter ( this will work even with latest Jupyter notebook version 5.3.7 as well), it will work.
I am still investigating why the latest version is not opening with the base environment. however, we can use solution 1 or 2 based on your preference.
There may be access privileges issues with installing in the \Program Files folder.
I have Anaconda3 and installed into the root C:\ directory and had no problems with dll file installation like you have.
Try installing Anaconda3 as Anaconda3 with no spaces directly as its own folder in the C:\ directory.
Once installed, you can use the Anaconda Cheat Sheet to get started quickly to verify that installation works by going into the Anaconda3 folder and (if you are on Windows) SHIFT+RIGHT-CLICK-MOUSE and it will give you menu with open to open Command [Line] Window directly in that directory of Anaconda3. Open the Command Line window and run the commands from the Anaconda Cheat Sheet to quickly get started:
http://conda.pydata.org/docs/_downloads/conda-cheatsheet.pdf
You will need to follow instructions to create virtual Python development environment/folder within the Anaconda3. Then you will need to make sure you install the Jupyter Notebook into that virtual env/folder. Of course you will need to "activate" that virtual env after installing.
I hope this helps.
Regarding the issue of opening Jupyter Notebook with Anaconda, I was having this error message:
[W 12:34:52.309 LabApp] Permission to listen on port 8984 denied.
[C 12:34:52.309 LabApp] ERROR: the notebook server could not be started because no available port could be found.
It was trying each port but failing because of no permission. Running jupyter on a custom port fixed the problem:
jupyter notebook --port 9999
I just wasn't able to start Jupyter notebook directly after the installation.
Using a new terminal window was the solution for me.
I am a newbie to python and needed to set up IPython for some project-work. I followed the Anaconda Installation Directions . Currently I am having a lot of problem in running IPython :
First I installed Anaconda in my home directory : \home\pranav
Next I ran the command conda just to check if the installation was correct - it turned out to be prefectly fine
When I type in ipython OR ipython notebook , I get the following error :
Traceback (most recent call last):
File "/usr/local/bin/ipython", line 7, in <module>
from IPython import start_ipython
ImportError: No module named IPython
Can someone help me out ? Changing / Adding the PATH Variable is not working as suggested elsewhere on Stack Overflow
What was required was just a clean install of IPython :
pip install ipython
pip install 'ipython[all]'
Works like a charm :)
Ipython is probably not installed. Try running the below commands
conda update conda
conda update ipython ipython-notebook ipython-qtconsole
It was installed in my base environment but not in an newly created Python 3.6 environment so I had to activate it and then run conda install -c anaconda ipython from here: https://anaconda.org/anaconda/ipython
I just ported a working django app from a windows system to ubuntu by just copying all the files to /var/www/some/dir/djangoApp. But now, when executing
python manage.py runserver 8080
I get the Error:
ImportError: no module named django
I have already installed a fresh version of django with python setup.py install to /usr/local/lib/python2.7/dist-packages/django/ and added the path to PYTHONPATH.
The linux system in not maintained by me and has numerous python versions installed.
calling >>> import django in the shell does not raise an ImportError.
I'm very confused. Please help me!
Here's the traceback from the console:
Traceback (most recent call last):
File "manage.py", line 13, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 280, in execute
translation.activate('en-us')
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py", line 130, in activate
return _trans.activate(language)
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 188, in activate
_active.value = translation(language)
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 159, in _fetch
app = import_module(appname)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
ImportError: No module named django
Since you just migrated to a UNIX environment, i suggest you migrate also to the best practices on such a platform too.
Download PIP
sudo apt-get install python-pip
Download and install virtualenv to set up a separate python virtual environment for your apps. This will allow you to run different flavors of django and other software without conflicts.
sudo pip install virtualenv
Create virtual environment by running. You will get a folder called myvirtualenvironment with a bin folder and a few executables inside it.
virtualenv myvirtualenvironment --no-site-packages
In order to tell your shell that you're working with that newly created virtual environment you need to run the activate script found in /myvirtualenvironment/bin/
source myvirtualenvironment/bin/activate
Now you can install django specifically to that virtual environment.
pip install django OR pip install django==1.6 depending on what version you want to install. If you don't specify, the latest version will be installed.
Now, migrate your Django project inside of /myvirtualenvironment/ and run the the runserver command.
Sometimes there are some .pyc files in the directories and you don't get any error from the console. Trying to install Django from pip.
sudo pip install django
Best practices advise to create a requirements.txt file (From you Windows installation)
pip freeze > requirements.txt
And then create a new virutalenv to install every package
mkvirtualenv myapp
pip install -r requirements.txt
I landed on this page after getting the same error (On a site I've been actively developing just fine for months). For me #asaji's answer reminded me that I had forgotten to launch my virtual env.
After launching my Virtual Env . Scripts/activate it worked great!
It seems like quite a big job for a problem that (MIGHT) be very small.
I had this exact problem, it was working one day, and then the next day it wasn't working anymore. I'm pretty new to Linux and Django in general but knows python well so didn't really know where to look other than "Virtual environment"
I started installing virtual environments again (like some people suggest) BUT DON'T!
At least not until you tried this and think about it:
Did you install your virtual environment as a temp one(did you perhaps install it like this: "pip install pipenv"?)
if you did(like you should have done it) you will have somewhere around your current django project 2 files - pipfile & pipfile.lock
open your terminal, cd to the path of those files(same folder)
write in terminal: pipenv shell
BOOM: You just reactivated your "TEMPORARY" virtual environment and Django works exactly as it should, will and did.