Trouble with ipython notebook after upgrading ubuntu to 17.10 - python

I recently upgraded ubuntu from 16.04 to 17.10.
Afterwards, when I try
sudo pip install jupyter
graphlab-create 2.1 has requirement decorator==4.0.9, but you'll have decorator 4.3.0 which is incompatible.
graphlab-create 2.1 has requirement requests==2.9.1, but you'll have requests 2.18.1 which is incompatible.
Cannot uninstall 'pyzmq'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
When I try running
ipython notebook
File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 445, in initialize_subcommand
subapp = import_item(subapp)
File "/usr/local/lib/python2.7/dist-packages/ipython_genutils/importstring.py", line 31, in import_item
module = __import__(package, fromlist=[obj])
ImportError: No module named notebook.notebookapp

Create a separate virtualenv and install Jupyter there. If you still face the same error, downgrade pip. I am assuming you are having pip version 10. You can downgrade by doing pip install pip==9.0.1. Try installing Jupyter now.
If you don't want to downgrade pip, you have to manually remove all those packages, pyzmq in this case, from site-packages directory before installing Jupyter.
Reference: https://github.com/pypa/pip/issues/5247

Related

Module six not found, although module six is installed

I cannot run jupyter lab as it complains about module six. Module six is already installed with conda. I even tried to install with pip too, but it says it is already installed and doesn't do anything. So, what to do here?
jupyter lab
Traceback (most recent call last):
File "c:\users\ilyas\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\ilyas\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\ilyas\Anaconda3\Scripts\jupyter-lab.EXE\__main__.py", line 5, in <module>
File "c:\users\ilyas\anaconda3\lib\site-packages\jupyterlab\labapp.py", line 11, in <module>
from jupyter_core.application import JupyterApp, base_aliases
File "c:\users\ilyas\anaconda3\lib\site-packages\jupyter_core\application.py", line 30, in <module>
from traitlets.config.application import Application, catch_config_error
File "c:\users\ilyas\anaconda3\lib\site-packages\traitlets\__init__.py", line 1, in <module>
from .traitlets import *
File "c:\users\ilyas\anaconda3\lib\site-packages\traitlets\traitlets.py", line 57, in <module>
import six
ModuleNotFoundError: No module named 'six'
I tried to remove with conda, and then re-install but that also did not work:
conda remove six
RemoveError: This operation will remove conda without replacing it with
another version of conda.
Install with pip:
pip install six
Requirement already satisfied: six in c:\users\ilyas\anaconda3\lib\site-packages (1.12.0)
python -m pip install six
Requirement already satisfied: six in c:\users\ilyas\anaconda3\lib\site-packages (1.12.0)
Environment:
Windows 10
python 3.7
jupyter-lab 1.0.0a3
six 1.12.0
you are installing six for Python 2, but trying to use it from Python 3.
install for Python 3 with:
python3 -m pip install six
Tried the following but still NOT solved:
I had to do this in the following error:
pip uninstall six
pip install six
Then I get the the ModuleNotFoundError: No module named 'jupyter_server' error.
So I install jupyter_server with conda, and now the jupyter lab is working.
conda install -c conda-forge jupyter_server
Even though the notebook is opening, I could not import packages. Checking the command prompt was showing the jupyterlab-manager was outdated. So, did the following:
jupyter labextension install #jupyter-widgets/jupyterlab-manager
Still, the notebook opens but cannot do anything with it.
few years late but I had the same problem. To add a little to what Corey was saying. I think you need to install it via Conda to use it in Conda (and hence Jupyter), i.e.
conda install six

Tensorflow error : DLL load failed: The specified procedure could not be found

I tried to install tensorflow cpu using pip in my windows8.1 64bit python3.6.0
using pip install tensorflow
but it gives me this error:
Traceback (most recent call last): File "C:\Users\Laitooo
San\Desktop\tf.py", line 1, in <module>
import tensorflow as tf File "C:\Users\Laitooo San\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py",
line 24, in <module>
from tensorflow.python import * File "C:\Users\Laitooo San\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\__init__.py",
line 52, in <module>
from tensorflow.core.framework.graph_pb2 import * File "C:\Users\Laitooo
San\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\core\framework\graph_pb2.py",
line 6, in <module>
from google.protobuf import descriptor as _descriptor File "C:\Users\Laitooo
San\AppData\Local\Programs\Python\Python36\lib\site-packages\google\protobuf\descriptor.py",
line 47, in <module>
from google.protobuf.pyext import _message ImportError: DLL load failed: The specified procedure could not be found.
I downloaded python36.dll and made sure all other .dll is there and install Microsoft visual c++ 2015
I also uninstalled tensorflow and installed another version several times but without any result.
I had this error as well, and was able to resolve it by downgrading protobuf from 3.6.1 to 3.6.0:
pip install protobuf==3.6.0
windows 10
python 3.6
Cuda 9.0
cudnn-9.0-windows10-x64-v7.6.3.30
tensorflow-gpu == 1.12.0
keras == 2.2.4
problem was:
ImportError: DLL load failed: The specified procedure could not be
found.
solved with:
pip install protobuf==3.6.0
There is a similar issue on Github:
Tensorflow issue
Problem should be resolved if you install the wheel file provided in one of the answers. You can find the wheel file here.
Wheel file
You can install the wheel file with pip. First change the current directory to install location. Then,
pip install tensorflow-1.6.0-cp36-cp36m-win_amd64.whl
All official tensorflow binaries since 1.6 were made with AVX, rendering older CPUs unsupported.
In order to install recent tensorflow versions on an older CPU you can simply install tensorflow from a non-avx built wheel ( you can find some here)
pip install <path to the downloaded .whl file>
its the problem with python=3.6.0
Upgrade to any higher versions of python 3.6
Updating from python 3.6.0 to python 3.6.4 fixed this issue for me.
I got this (unhelpful) error after installing on python 3.7. Turns out I had not installed cuDNN, the neural network package. After that, it runs without issue.
I had the same problem.
I made it work by uninstalling scipy and then reinstalling.
First uninstall seaborn.
pip uninstall seaborn
then uninstall scipy.
pip uninstall scipy.
After that install both scipy and seaborn.
pip install scipy,
pip install seaborn
I hope it helps

virtualenvwrapper fails with "No module named Help2Man"

I'm trying to install virtualenvwrapper (4.7.2) on El Capitan using
pip install virtualenvwrapper
This is a brew installed python/pip version (python 2.7.12, pip 8.1.2). The installation fails with
...
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2235, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: No module named Help2Man
A help2man python module doesn't seem to exist anywhere, I could only find a command line tool with that name. Any ideas?
I was able to fix this thanks to this thread. I had a package installed with invalid distutils.command entry points (in my case obspy 1.0.2 - this seems to be fixed in 1.0.3) which causes this error to pop-up in totally unrelated places.
I uninstalled obspy, installed virtualenvwrapper, then reinstalled obspy

On a Mac how do I remove Openpyxl when it has already been installed before using sudo pip install openpyxl?

Previously openpyxl was installed on a mac. I need to remove it or fix it because it seems to be broken and then I want to reinstall it. Every time i try easy_install -m openpyxl it doesn't work or doing a new install doesn't work. I receive a syntax error.
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pip-8.1.2-py2.5.egg/pip/__init__.py:208: Warning: 'as' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/runpy.py", line 88, in run_module
code = loader.get_code(mod_name)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py", line 283, in get_code
self.code = self._get_delegate().get_code()
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py", line 275, in get_code
self.code = compile(source, self.filename, 'exec')
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pip-8.1.2-py2.5.egg/pip/__init__.py", line 208
except PipError as exc:
I am a def newbie when it comes to not only coding but python.
You can try uninstalling it first using pip with the command sudo pip uninstall openpyxl.
Having said that, it looks like the error is because you're using Python 2.5 and "as" became a reserved keyword in Python 2.6. Your best bet is to install a new version of Python and install openpyxl, or find a version of openpyxl and pip that supports Python 2.5.
Reading up on openpyxl, it looks like the last version that supported Python 2.5 is version 1.7.0. See the package's PyPI page. And the version of pip that supports Python 2.5 is 1.3.1.
So first you need to downgrade pip. The version of pip is FUBARed, so you will have to install pip 1.3.1 from source. Download it from the PyPI page, unpack it and go into the folder with the file setup.py. Then run python setup.py build followed by sudo python setup.py install. This should have downgraded pip.
Next install openpyxl version 1.7.0 sudo pip install openpyxl==1.7.0.

Can't use Jupyter Notebook: jsonschema apparently missing

When using an Anaconda environment, I can't start Jupyter to work in a notebook. I can do so without the environment, but I need to be able to use the environment. Here's what I do and the errors I get:
ben#ben-K60IJ:~/surveillance_sound_classifier/surveillance_sound_classifier$ source activate EECS352
discarding /home/ben/anaconda/bin from PATH
prepending /home/ben/anaconda/envs/EECS352/bin to PATH
(EECS352)ben#ben-K60IJ:~/surveillance_sound_classifier/surveillance_sound_classifier$ jupyter notebook
Traceback (most recent call last):
File "/home/ben/anaconda/envs/EECS352/bin/jupyter-notebook", line 4, in <module>
import notebook.notebookapp
File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/notebook/notebookapp.py", line 61, in <module>
from .services.contents.manager import ContentsManager
File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/notebook/services/contents/manager.py", line 16, in <module>
from nbformat import sign, validate, ValidationError
File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/nbformat/__init__.py", line 33, in <module>
from .validator import validate, ValidationError
File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/nbformat/validator.py", line 21, in <module>
raise ImportError(str(e) + verbose_msg)
ImportError: No module named functools32
Jupyter notebook format depends on the jsonschema package:
https://pypi.python.org/pypi/jsonschema
Please install it first.
Yes, I've done pip install jsonschema and conda install jsonschema AND pip install functools32 and conda install functools32 from within the EECS352 environment to no avail; I arrive at an almost identical error, except this time, functools32 is replaced with _version.
I've reinstalled Anaconda, updated all its packages, created a new environment in the same way I created this one, and still I get this error. I'm using Ubuntu 15.10 32-bit. I used to be able to use this environment with no problems until roughly a week ago.
If this is a duplicate, please point me to the original; however, I haven't yet found anything that seems really relevant. The only thing that might be relevant is that this error did pop up after I modified some .conf file because I was having issues updating my computer's software using sudo apt-get upgrade. I don't recall what I had done and to which file, but if it's likely the source of this issue, I can spend some time trying to track it down. Please let me know if I should spend my time to do this, and I will.
I think I have a solution.
I did may things, regenerated my env (anaconda env) from another computer where it worked, but no success.
What I think that nailed it is upgrading jsonschema to 2.5.1
Here are my steps from "bad" jupyter env to working jupyter env.
Good luck and come back if it doesn't work, I will post the notebook* relevant versions.
>conda upgrade pip
pip: 8.1.0-py27_0 --> 8.1.1-py27_0
setuptools: 20.2.2-py27_0 --> 20.3-py27_0
>pip install functools32
Downloading functools32-3.2.3-2.tar.gz
Successfully installed functools32-3.2.3.post2
>jupyter notebook
ImportError: No module named _version
Jupyter notebook format depends on the jsonschema package:
https://pypi.python.org/pypi/jsonschema
Please install it first.
>pip install jsonschema
Requirement already satisfied
>pip install --upgrade jsonschema
Collecting jsonschema
Downloading jsonschema-2.5.1-py2.py3-none-any.whl
Successfully uninstalled jsonschema-2.4.0
Successfully installed jsonschema-2.5.1
>jupyter notebook
[I 16:45:41.708 NotebookApp] Writing notebook server cookie secret to
[I 16:45:42.134 NotebookApp] Serving notebooks from local directory:
[I 16:45:42.134 NotebookApp] 0 active kernels
[I 16:45:42.134 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
i also got the same error and none of the above mentioned procedures worked for me so i've checked the documentation of anaconda and found something useful
conda install -c conda-forge/label/cf201901 jsonschema
conda install jupyter
jupyter notebook
this worked for me,thanks to anaconda documentation
Re-install jsonschema solve the problem in my case:
$ pip uninstall jsonschema
...
$ pip install jsonschema
...
If any of the above mentioned solution didn't work then try this in your anaconda prompt: First run conda update -n root conda so you have the latest conda version installed. Then run conda update --all This will update all packages in the current environment to the latest version.
Even after installing jsonschema, your Jupyter Notebook might not run and give you the error:
Jupyter notebook format depends on the jsonschema package:
https://pypi.python.org/pypi/jsonschema
Please install it first
Then I suggest you to run the given two commands. It will solve your issue as it solved mine.
Try this from the terminal:
pip install ipython[notebook]
It worked for me, let me know if the problem still exists.
I had the same problem.
I solved it by running this command
conda install -c anaconda jsonschema
https://anaconda.org/anaconda/jsonschema
I solved it by just uninstalling and reinstalling python 3.7
Try this from terminal, it worked to me:
pip install --upgrade pyrsistent

Categories