ImportError: No module named 'jupyter_client' - python

I am trying to install RODEO on my debian jessie box. I've successfully pip installed rodeo and the installation was completed without any issues. However, when I type rodeo on the command line I am greeted with the following error message:
xxxxxx#yyyyy:~$ rodeo
/usr/local/lib/python3.4/dist-packages/IPython/kernel/__init__.py:13: ShimWarning: The `IPython.kernel` package has been deprecated. You should import from ipykernel or jupyter_client instead.
"You should import from ipykernel or jupyter_client instead.", ShimWarning)
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/rodeo/kernel.py", line 3, in <module>
from jupyter_client import BlockingKernelClient
ImportError: No module named 'jupyter_client'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/rodeo", line 9, in <module>
load_entry_point('rodeo==0.4.4', 'console_scripts', 'rodeo')()
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 549, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2542, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2202, in load
return self.resolve()
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2208, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/local/lib/python3.4/dist-packages/rodeo/cli.py", line 33, in <module>
from .rodeo import main
File "/usr/local/lib/python3.4/dist-packages/rodeo/rodeo.py", line 2, in <module>
from .kernel import Kernel
File "/usr/local/lib/python3.4/dist-packages/rodeo/kernel.py", line 5, in <module>
from IPython.kernel import BlockingKernelClient
File "/usr/local/lib/python3.4/dist-packages/IPython/kernel/__init__.py", line 31, in <module>
from ipykernel import comm, inprocess
ImportError: No module named 'ipykernel'
Could someone shed some light, as I have ipython installed. When searched for jupyter client in apt repos, I couldn't fine one. Any help would be appreciated.

IPython 4.0 has split into many packages, many of the notebook- and execution-related ones now being part of Jupyter.
If rodeo supports the 4.0 APIs, you can install these with:
pip install --upgrade jupyter
(Almost anything that worked with IPython 3 should work with IPython 4 and Jupyter, as long as the extra packages are installed. IPython includes shims for the imports that have moved.)
If that doesn't work, rodeo may require IPython 3.x for now. You can pin IPython to 3.x with:
pip install 'ipython[notebook]<4'

Related

Cfgrib is not installed correctly on WSL2 through pip

I'm trying to install cfgrib to my WSL2 Ubuntu however when I type python3 -m cfgrib selfcheck it gives the following error as follows.
Traceback (most recent call last):
File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/messages.py", line 42, in <module>
import pyeccodes.compat as eccodes
ModuleNotFoundError: No module named 'pyeccodes'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 184, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 143, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.8/runpy.py", line 110, in _get_module_details
__import__(pkg_name)
File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/__init__.py", line 19, in <module>
from .cfmessage import CfMessage
File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/cfmessage.py", line 29, in <module>
from . import messages
File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/messages.py", line 44, in <module>
raise exc
File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/messages.py", line 37, in <module>
from . import bindings as eccodes
File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/bindings.py", line 57, in <module>
raise RuntimeError(f"ecCodes library not found using {LIBNAMES}")
RuntimeError: ecCodes library not found using ['eccodes', 'libeccodes.so', 'libeccodes']
My python version is Python 3.8.2. Is it possible to install cfgrib through pip?
The latest release of cfgrib version 0.9.8.5 at PyPI doesn't declare eccodes or pyeccodes as a dependency, not even as extra. You can install one of them separately:
pip install eccodes
or
pip install pyeccodes
(I don't know what is the difference; cfgrib can use both).
The bug is fixed in the repository but not yet released to PyPI so you can try to install the latest version using git:
pip install --upgrade "git+https://github.com/ecmwf/cfgrib.git#egg=cfgrib"

Cannot install Orange 3 ImportError: PyQt4, PyQt5 or PySide are not available for import

I am using Ubuntu 14.04. I have created a virtual environment and installed Orange using
pip install orange3
I also installed PyQt4 using
sudo apt-get install python3-pyqt4
But when I launch orange3 from terminal I got the following error.
Traceback (most recent call last):
File "/home/arun/.virtualenvs/orange3env/bin/orange-canvas", line 11, in <module>
load_entry_point('Orange3', 'gui_scripts', 'orange-canvas')()
File "/home/arun/.virtualenvs/orange3env/lib/python3.4/site-packages/pkg_resources/__init__.py", line 561, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/arun/.virtualenvs/orange3env/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2649, in load_entry_point
return ep.load()
File "/home/arun/.virtualenvs/orange3env/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2303, in load
return self.resolve()
File "/home/arun/.virtualenvs/orange3env/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2309, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/home/arun/lab/orange3/Orange/canvas/__main__.py", line 21, in <module>
from AnyQt.QtGui import QFont, QColor, QDesktopServices
File "/home/arun/.virtualenvs/orange3env/lib/python3.4/site-packages/AnyQt/QtGui.py", line 1, in <module>
from . import _api
File "/home/arun/.virtualenvs/orange3env/lib/python3.4/site-packages/AnyQt/_api.py", line 96, in <module>
raise ImportError("PyQt4, PyQt5 or PySide are not available for import")
ImportError: PyQt4, PyQt5 or PySide are not available for import
Seems like you are missing a version of PyQt in the environment you run Orange from.
Best do something like pip3 install pyqt5 in the same terminal you pip-installed Orange.
Try this (works for me)
sudo apt install python3-pyqt5.qtsvg
https://thequickblog.com/orange3-no-module-named-pyqt5-qtsvg/

Ansible is not working on mac

I'm trying to execute ansible in my system. I guess I messed up something and unable to run ansible. When I run ansible --version, I see the following error:
krishnapatamset:bin krishna.patamsetti$ ansible --version
[WARNING]: log file at /var/log/ansible/ansible.log is not writeable and we cannot create it, aborting
ERROR! Unexpected Exception: No module named markupsafe
the full traceback was:
Traceback (most recent call last):
File "/usr/local/bin/ansible", line 80, in <module>
from ansible.cli.adhoc import AdHocCLI as mycli
File "/usr/local/lib/python2.7/site-packages/ansible/cli/adhoc.py", line 28, in <module>
from ansible.executor.task_queue_manager import TaskQueueManager
File "/usr/local/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py", line 29, in <module>
from ansible.executor.play_iterator import PlayIterator
File "/usr/local/lib/python2.7/site-packages/ansible/executor/play_iterator.py", line 30, in <module>
from ansible.playbook.block import Block
File "/usr/local/lib/python2.7/site-packages/ansible/playbook/__init__.py", line 27, in <module>
from ansible.playbook.play import Play
File "/usr/local/lib/python2.7/site-packages/ansible/playbook/play.py", line 27, in <module>
from ansible.playbook.base import Base
File "/usr/local/lib/python2.7/site-packages/ansible/playbook/base.py", line 29, in <module>
from jinja2.exceptions import UndefinedError
File "/usr/local/lib/python2.7/site-packages/jinja2/__init__.py", line 33, in <module>
from jinja2.environment import Environment, Template
File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 13, in <module>
from jinja2 import nodes
File "/usr/local/lib/python2.7/site-packages/jinja2/nodes.py", line 19, in <module>
from jinja2.utils import Markup
File "/usr/local/lib/python2.7/site-packages/jinja2/utils.py", line 531, in <module>
from markupsafe import Markup, escape, soft_unicode
ImportError: No module named markupsafe
Can anyone please help me with this situation. Thanks in advance
I even tried pip install markupsafe but still I am unable to get ansible working
Ansible is based on python and there is a python module that's missing called markupsafe
install it via pip, you may need to escalate privileges
pip2 install -I markupsafe
pip2 for python 2.x
-I to ignore and reinstall package if it's already installed
I uninstalled pip and installed it again.
brew uninstall pip
brew doctor
brew install pip

running pyinstaller after Anaconda install results in ImportError: no Module named 'pefile'

I did conda install -c acellera pyinstaller=3.2.3 as per Anaconda's website and it looks like it installed correctly but I get the following if I try to run it via cmd:
C:\Users\Cornelis Dirk Haupt\PycharmProjects\Mesoscale-Brain-Explorer\src>pyinstaller
Traceback (most recent call last):
File "C:\Anaconda3\Scripts\pyinstaller-script.py", line 9, in <module>
load_entry_point('PyInstaller==3.3.dev0+g8756735', 'console_scripts', 'pyinstaller')()
File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 542, in load_entry_point
File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2569, in load_entry_point
File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2229, in load
File "C:\Anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2235, in resolve
File "C:\Anaconda3\lib\site-packages\PyInstaller\__main__.py", line 21, in <module>
import PyInstaller.building.build_main
File "C:\Anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 34, in <module>
from .api import PYZ, EXE, COLLECT, MERGE
File "C:\Anaconda3\lib\site-packages\PyInstaller\building\api.py", line 38, in <module>
from PyInstaller.utils.win32 import winmanifest, icon, versioninfo, winresource
File "C:\Anaconda3\lib\site-packages\PyInstaller\utils\win32\versioninfo.py", line 17, in <module>
import pefile
ImportError: No module named 'pefile'
What's going on? Pyinstaller works fine with python 2.7 without Anaconda. But I've recently decided to make the jump to Anaconda + 3.5. I cant find any module named pefile or how to install it with Anaconda. I can install pefile easily using pip3 though.
You can use Anaconda's pip to install it, just go to the Script folder in Anaconda and execute:
pip.exe install pefile
install this instead:
conda install -c conda-forge pyinstaller=3.2.1
working fine for me after a couple of tries!

import error when trying to use pip command in ubuntu terminal

I just installed pip with ubuntu onto my laptop. Whenever I try to use pip in the terminal, I keep getting this error:
lopuj#lopuj-Dell-System-XPS-L502X:~$ pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 357, in load_entry_point
def get_entry_info(dist, group, name):
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 2394, in load_entry_point
break
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 2108, in load
name = some.module:some.attr [extra1,extra2]
ImportError: No module named 'pip'
lopuj#lopuj-Dell-System-XPS-L502X:~$ ^C
lopuj#lopuj-Dell-System-XPS-L502X:~$
How can I stop this from happening so i can just type in commands like 'pip install Django==1.7.1'?
Your referencing
usr/local
but pip is installed at
usr/lib
Check your installation. I would reinstall using esay_install and then open/close terminal.

Categories

Resources