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"
Related
Installed plasticityai/magnitude (https://github.com/plasticityai/magnitude#installation)
Getting the following error when trying to run:
ModuleNotFoundError: No module named 'spacy.lang.en.tag_map'
I have reinstalled spacy with newest version using pip3. Running python3.
Command I am trying to run:
python3 -m pymagnitude.converter -i /Users/rob/Desktop/videos/glove.6B/glove.6B.300d.txt -o /Users/rob/Desktop/vectors/
Full output:
Traceback (most recent call last):
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 188, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 111, in _get_module_details
__import__(pkg_name)
File "/usr/local/lib/python3.9/site-packages/pymagnitude/__init__.py", line 80, in <module>
from pymagnitude.third_party.allennlp.commands.elmo import ElmoEmbedder
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/__init__.py", line 8, in <module>
from allennlp.commands.configure import Configure
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/__init__.py", line 13, in <module>
from allennlp.commands.predict import Predict
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/predict.py", line 54, in <module>
from allennlp.predictors.predictor import Predictor, JsonDict
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/predictors/__init__.py", line 13, in <module>
from allennlp.predictors.constituency_parser import ConstituencyParserPredictor
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/predictors/constituency_parser.py", line 7, in <module>
from spacy.lang.en.tag_map import TAG_MAP
ModuleNotFoundError: No module named 'spacy.lang.en.tag_map'' ```
Issue is version of Spacy installed via pip was incorrect. Uninstalled Spacy from global pip, and works fine.
My python3 kernel for jupyter notebook was not starting, so I uninstalled it. I then ran these commands to create a new python3 kernel.
python3 -m pip install ipykernel
python3 -m ipykernel install --user
However, I get an error when running python3 -m ipykernel install --user.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/ipykernel/__init__.py", line 2, in <module>
from .connect import *
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/ipykernel/connect.py", line 11, in <module>
from IPython.core.profiledir import ProfileDir
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/IPython/__init__.py", line 56, in <module>
from .terminal.embed import embed
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/IPython/terminal/embed.py", line 16, in <module>
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/IPython/terminal/interactiveshell.py", line 19, in <module>
from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
from .application import Application
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/application/__init__.py", line 1, in <module>
from .application import Application
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/application/application.py", line 42, in <module>
from prompt_toolkit.buffer import Buffer
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/buffer.py", line 33, in <module>
from .auto_suggest import AutoSuggest, Suggestion
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/auto_suggest.py", line 19, in <module>
from .document import Document
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/document.py", line 8, in <module>
from typing import (
ImportError: cannot import name 'NoReturn'
This is the same error I was getting with the original python3 kernel before I removed it. How can I solve this issue?
I solved this issue by uninstalling and reinstalling Anaconda.
It seems, like it's problem with python version, Typing.NoReturn is new for python 3.6.2.
Try to install prompt-toolkit with a lower version, for instance 2.0.10. It worked for me:
python3 -m pip install prompt-toolkit==2.0.10
Then try again:
python3 -m ipykernel install --user
I used PythonAnywhere to host some Python scripts that required the fbchat module. I installed the module on Python 3.6 (with user scheme) without using virtualenv, and the module installed enum34 as a dependency.
I know enum34 is incompatible with Python versions greater than 3.4. However I can't uninstall it now either because calling pip3.x gives this error:
Traceback (most recent call last):
File "/usr/local/bin/pip3.6", line 4, in <module>
import re
File "/usr/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
and the command $ python3.6 -m pip gives:
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/usr/local/lib/python3.6/dist-packages/pip/__init__.py", line 4, in <module>
import locale
File "/usr/lib/python3.6/locale.py", line 16, in <module>
import re
File "/usr/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
These are the exact steps to reproduce, and the only commands used to get here:
$ pip3.6 install --user fbchat
Just delete the package from your site-packages folder manually.
Locate it first:
python3.6 -c 'import enum; print(enum.__file__)'
then delete the whole enum directory that file lives in, it'll be in a site-packages directory. Delete the enum34-<version>.dist-info file next to it too.
Because you used --user, the package was installed in your user-site directory. You can get the location with the site module too:
python3.6 -m site --user-site
so you can remove the offending package with:
rm -rf `python3.6 -m site --user-site`/enum
rm `python3.6 -m site --user-site`/enum-*.dist-info
Trying install PIP.
I have python 2.7 installed on Windows 7 (32-bit)
I created a file called get-pip.py as instructed here: https://pip.pypa.io/en/stable/installing/
When I run that file with python, I get the following error. The user account has admin rights.
Does anyone know what is going on?
C:\Python27>python get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 20061, in <module>
main()
File "get-pip.py", line 194, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
import pip
File "c:\users\sek~1.sek\appdata\local\temp\tmpvkex0l\pip.zip\pip\__init__.py", line 21, in <module>
File "c:\users\sek~1.sek\appdata\local\temp\tmpvkex0l\pip.zip\pip\_vendor\requests\__init__.py", line 62, in <module>
File "c:\users\sek~1.sek\appdata\local\temp\tmpvkex0l\pip.zip\pip\_vendor\requests\packages\__init__.py", line 27, in <module>
File "c:\users\sek~1.sek\appdata\local\temp\tmpvkex0l\pip.zip\pip\_vendor\requests\packages\urllib3\__init__.py", line 8, in <module>
File "c:\users\sek~1.sek\appdata\local\temp\tmpvkex0l\pip.zip\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 41, in <module>
File "c:\users\sek~1.sek\appdata\local\temp\tmpvkex0l\pip.zip\pip\_vendor\requests\packages\urllib3\request.py", line 7, in <module>
File "c:\users\sek~1.sek\appdata\local\temp\tmpvkex0l\pip.zip\pip\_vendor\requests\packages\urllib3\filepost.py", line 9, in <module>
File "c:\users\sek~1.sek\appdata\local\temp\tmpvkex0l\pip.zip\pip\_vendor\requests\packages\urllib3\fields.py", line 2, in <module>
File "C:\Python27\lib\email\utils.py", line 313
fallback charset='us-ascii'):
^
SyntaxError: invalid syntax
C:\Python27>
Do I need to install pip?
pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4 binaries downloaded from python.org, but you'll need to upgrade pip.
Just add pip to your environment path:
<python install dir>/Scripts/
Which can be easily done using an elevated command-prompt:
setx path "%path%;<python install dir>/Scripts/"
Then, upgrade it:
python -m pip install -U pip
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'