pygrib
pygrib copied to clipboard
How can installation be fixed?
No offense, but the installation of pygrib is a challenge, to say the least. Especially when deploying a production system.
The first problem is that setup.py
fails if pyproj is not installed in advance. It does not seem to me that setup.py
relies upon pyproj, so this check can probably be dropped.?
Further, setup.py
naturally relies on NumPy, a well known problem for many other libraries as well.
Thanks to PEP 518, this can now be overcome by including a file pyproject.toml
that specifies what tools are required in the build process. Recent versions of pip will then install these tools before running setup.py
:
[build-system]
requires = ["setuptools", "wheel", "numpy>=1.10"]
What are your thoughts about this? Would you accept a pull request dealing with these issues?
This PR might fix the above problem: https://github.com/jswhit/pygrib/pull/90
Install ought to work now, but use might still require you to manually install pyproj
depending on your specifics.
Are you sure? setup.py
in the master branch still fails on my machine (Python 3.6.7, latest pip):
$ pip --version
pip 18.1 from /xxx/pygrib/venv/lib/python3.6/site-packages/pip (python 3.6)
(venv) xxx/pygrib (master)
$ pip install -e .
Looking in indexes: https://pypi.org/simple/
Obtaining file://xxxx/pygrib
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/rg/Desktop/pygrib/setup.py", line 2, in <module>
import os, glob, numpy, sys
ModuleNotFoundError: No module named 'numpy'
I'll see if I can squeeze in some time to fix it once and for all.
In addition to #112, I created a wheel that you can use which should make the install process as simple as putting the wheel in your requirements.txt instead of just pygrib
:
wheel: https://github.com/kallsyms/pygrib/releases/download/v2.0.4-wheel/pygrib-2.0.4-cp36-cp36m-manylinux1_x86_64.whl corresponding github release with build steps: https://github.com/kallsyms/pygrib/releases/tag/v2.0.4-wheel
I cloned the repo, installed numpy
and pyproj
, and I still get:
/usr/bin/ld: cannot find -leccodes
collect2: error: ld returned 1 exit status
/home/pygrib/setup.py:41: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.
config = _ConfigParser()
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/usr/local/bin/python -c 'import setuptools, tokenize;__file__='"'"'/home/pygrib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps" failed with error code 1 in /home/pygrib/
@preeth1 have you installed libeccodes-dev
(assuming you're on ubuntu)?
@kallsyms - that was the issue, this helped me: https://gist.github.com/emmanuelnk/406eee50c388f4f73dcdff521f2aa7b2 thanks!