Set up cassandra driver (python) in Docker - python

I used a docker file several months ago that (1) uses base ubuntu image, (2) installs miniconda python distribution, (3) installs some python libraries using miniconda, (4) runs following commands to set up cassandra-driver for python.
RUN pip install --upgrade pip
RUN pip install cassandra-driver
This worked perfectly six months ago. But now I'm getting this exception.
Step 13 : RUN pip install cassandra-driver
---> Running in ba9955650d7c
Collecting cassandra-driver
Downloading cassandra-driver-3.0.0.tar.gz (186kB)
Complete output from command python setup.py egg_info:
warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Utility'
unable to execute 'gcc': No such file or directory
Unable to find pgen, not compiling formal grammar.
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-0XzsPv/cassandra-driver/setup.py", line 375, in <module>
run_setup(None)
File "/tmp/pip-build-0XzsPv/cassandra-driver/setup.py", line 373, in run_setup
**kw)
File "/miniconda/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/dist.py", line 268, in __init__
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/dist.py", line 312, in fetch_build_eggs
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/pkg_resources/__init__.py", line 846, in resolve
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/pkg_resources/__init__.py", line 1091, in best_match
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/pkg_resources/__init__.py", line 1103, in obtain
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/dist.py", line 379, in fetch_build_egg
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/command/easy_install.py", line 639, in easy_install
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/command/easy_install.py", line 669, in install_item
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/command/easy_install.py", line 852, in install_eggs
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/command/easy_install.py", line 1080, in build_and_install
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/command/easy_install.py", line 1068, in run_setup
distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-0XzsPv/cassandra-driver
The command '/bin/sh -c pip install cassandra-driver' returned a non-zero code: 1
What might be going wrong? Is the installation package broken or I'm not doing it right?

The python cassandra-driver now uses Cython extensions by default since version 2.7.0, but there is an escape hatch for those who don't have easy access to the cython distribution or don't need it which might be a good option for you as well. The cython extensions do offer a boon to performance, but it might not be suitable for a lot of cases (especially where you are not doing high throughput).
From the install documentation:
By default, this package uses Cython to optimize core modules and build custom extensions. This is not a hard requirement, but is engaged by default to build extensions offering better performance than the pure Python implementation.
This build phase can be avoided using the build switch, or an environment variable:
python setup.py install --no-cython
-or-
pip install --install-option="--no-cython" <spec-or-path>
Alternatively, an environment variable can be used to switch this option regardless of context:
CASS_DRIVER_NO_CYTHON=1 <your script here>

In order to install cassandra-driver you need to compile some C source files however you don't have gcc inside your container:
unable to execute 'gcc': No such file or directory
Try to install gcc and python-dev packages before installing cassandra-driver:
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python-dev \
gcc \
&& rm -rf /var/lib/apt/lists/*

Related

Unable to install autodock vina (potentially due to boost)

As part of a script I am writing, I need to install the package autodock vina for the purpose of ligand and protein binding. Every time I attempt to "pip install vina", I recieve an error message " ValueError: Boost library location was not found!". Upon attempting to install boost manually, I have been unable to run the bootstrap file, as it does not make the b2 folder that online tutorials say it will make.
To resolve this issue, I installed conda, and made an active environment with every single prerequisite, including boost, installed. I have checked for the version of all of these prerequisites and confirmed their existence, as well as double and triple-checking that I am in the write active environment. Upon installation, I either get the same issue (using conda install vina) or when using "conda install -c bioconda autodock-vina", I get a message saying that the package does not exist (despite adding cforge and bioconda as active package handlers, and the existence of said package is clearly documented online). Does anyone have any suggestions? I've been attempting to install this piece of software for 3 days and I've completely exhausted the documentation, as well as all other similar question answers, with nothing working.
Full error message:
Collecting vina
Using cached vina-1.2.3.tar.gz (95 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [56 lines of output]
Version found 1.2.3 (from __init__.py)
running egg_info
creating vina.egg-info
writing vina.egg-info\PKG-INFO
writing dependency_links to vina.egg-info\dependency_links.txt
writing requirements to vina.egg-info\requires.txt
writing top-level names to vina.egg-info\top_level.txt
writing manifest file 'vina.egg-info\SOURCES.txt'
Boost library is not installed in this conda environment.
Traceback (most recent call last):
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 177, in get_requires_for_build_wheel
return self._get_build_requires(
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 159, in _get_build_requires
self.run_setup()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 346, in <module>
setup(
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\dist.py", line 1214, in run_command
super().run_command(command)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 308, in run
self.find_sources()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 315, in find_sources
mm.run()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 550, in run
self.add_defaults()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 587, in add_defaults
sdist.add_defaults(self)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 228, in add_defaults
self._add_defaults_ext()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 311, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "setup.py", line 247, in finalize_options
raise ValueError(error_msg)
ValueError: Boost library location was not found!
Directories searched: conda env, /usr/local/include and /usr/include.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I also get this error. I asked ResearchGate how to solve this problem and Cheng Shen adviced to use WSL/WSL2 to simulate a Linux environment and then run conda install -c bioconda vina (or another command like this)
What I did.
Install WSL and Ubuntu on Windows 2. Run code . in WSL terminal (for installing VS Code [recommended])
Install Anaconda/Miniconda following this guide
Type conda install -c bioconda vina in Ubuntu terminal (bioconda channel will download all required packages - boost, swig, etc.)
Vina should be successfully installed ( vina --version in WSL Terminal to check)
I found it much easier to install packages for docking via WSL and use VS Code to run scripts there. It's VERY easier than trying to solve this problem by configuring boost for Windows. If you have any questions you can ask me in ResearchGate.

installing python module on linux

I am trying to install the python module pyobjus (this is the one that fails to install another module).
But I always get some bug during installation. I tried to switch to other python versions, reinstall pip, use option --no-cache-dir, etc, but couldn't manage to get past this bug:
$ pip3 install pyobjus
Defaulting to user installation because normal site-packages is not writeable
Collecting pyobjus
Using cached pyobjus-1.2.0.tar.gz (165 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf
cwd: /tmp/pip-install-4k26drr5/pyobjus
Complete output (19 lines):
Pyobjus platform is linux
Traceback (most recent call last):
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 150, in get_requires_for_build_wheel
config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 130, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 254, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 35, in <module>
class PyObjusBuildExt(build_ext, object):
NameError: name 'build_ext' is not defined
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf Check the logs for full command output.
Any help would be greatly appreciated.
My OS is Linux Mint 19.3.
I saw this question which is about the same problem, but following the links did not bring any answer. It says PyObjus is designed for MacOS, but then why does the module katrain, supposedly compatible with linux, tries to install it when running "pip3 install katrain" (giving the same error as above) ?
Edit adter Marat's suggestion:
I removed the test for ios, the installation goes a bit further, but fails because Python.h is missing. when trying to install python3-dev, apt-get says that broken packages such as python3.6-dev are flagged "left as is", so it cannot install the required ones. Is there a way to fix the python installation, which seems to be broken ? I am afraid to break all the system if I mess up with it too much, but there is clearly a problem with my installation...
Fixed the above issue by reinstalling stuff, now it is CoreFoundation.h that is missing...

Version conflict issue with Python packaging module

I was deploying OpenStack Newton devstack using stack.sh
I ran into the following issue :
Processing /opt/stack/requirements
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-2UrvLp-build/setup.py", line 29, in <module>
pbr=True)
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/opt/stack/requirements/.venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 320, in __init__
_Distribution.__init__(self, attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/opt/stack/requirements/.venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 386, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/opt/stack/requirements/.venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2318, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/opt/stack/requirements/.venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 859, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (packaging 16.7 (/opt/stack/requirements/.venv/lib/python2.7/site-packages), Requirement.parse('packaging>=16.8'))
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-2UrvLp-build/
+inc/python:pip_install:1 exit_trap
+./stack.sh:exit_trap:487 local r=1
++./stack.sh:exit_trap:488 jobs -p
+./stack.sh:exit_trap:488 jobs=
+./stack.sh:exit_trap:491 [[ -n '' ]]
+./stack.sh:exit_trap:497 kill_spinner
+./stack.sh:kill_spinner:383 '[' '!' -z '' ']'
+./stack.sh:exit_trap:499 [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:500 echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:501 generate-subunit 1486635146 55 fail
+./stack.sh:exit_trap:502 [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:505 /home/demo/devstack/tools/worlddump.py -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2017-02-09-101322.txt for details
+./stack.sh:exit_trap:511 exit 1
Looks like there is a version conflict for a package called 'packaging'.
Here's what I did - > Tried uninstall and re-installing the package by doing the following :
pip uninstall packaging
pip install --upgrade packaging
But it doesn't really help and I get the same error again.
Please help me resolve this issue, kindly be specific which command I should execute and in which directory.
I got the exact same error with devstack, here's how to fix it:
First add a global setting to log everything pip is doing. Create /etc/pip.conf with the following contents:
[global]
log = /var/log/pip.log
Then run:
sudo touch /var/log/pip.log
sudo chmod a+rw /var/log/pip.log
to make sure pip can always write to this file.
Then watch the changes related to the packaging package with:
tail -f /var/log/pip.log |grep packaging
And in parallel relaunch ./stack.sh .
At some point, in the pip logs you should see a line similar to:
Setting packaging===16.7 (from -c /opt/stack/requirements/upper-constraints.txt ...
This shows you where this requirement comes from, in this case it is from the /opt/stack/requirements/upper-constraints.txt file.
You can then manually edit the file in question to change this requirement to remove the conflict. In my case, I replaced:
packaging===16.7
by
packaging>=16.8
in /opt/stack/requirements/upper-constraints.txt
And after that the devstack installation completed without issues.
TL;DR
cd /opt/stack/requirements/
sed -i.bak s/packaging===16.7/packaging>=16.8/g upper-contraints.txt
try below commands
pip install --upgrade pip
pip install -r requirements.txt

CANNOT Install external modules in Canopy

I have set Canopy as my default python compiler.
I want to install scikits modules, currently not available in Canopy Package manager. I have installed setup tools and easy_install, pip which points to Canopy installation ( which easy_install -> Canopy directory). But I cannot use either of them to download any of the above modules.
More specifically fetching scikits.odes gives me this error log:
Cleaning up...
Removing temporary dir /private/var/folders/b3/cvy2g4393534zjsrgxgnmvch0000gn/T/pip_build_nick...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/b3/cvy2g4393534zjsrgxgnmvch0000gn/T/pip_build_nick/scikits.odes
Exception information:
Traceback (most recent call last):
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/basecommand.py", line 134, in main
status = self.run(options, args)
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/commands/install.py", line 236, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 1134, in prepare_files
req_to_install.run_egg_info()
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 259, in run_egg_info
command_desc='python setup.py egg_info')
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/util.py", line 670, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /private/var/folders/b3/cvy2g4393534zjsrgxgnmvch0000gn/T/pip_build_nick/scikits.odes
Similar error logs were thrown for the other module installation attempts I had made.
Any suggestions? How can I fix this obvious bug?
I suspect that by installing setuptools, you have corrupted the version of easy_install that is already included in in the distribute package, which is part of Canopy. I have updated this article to emphasize this caution.
Please delete your Canopy User Python directory, /Users/nick/Library/Enthought/Canopy_64bit/User/ and restart Canopy to re-create it without the conflicting version of setuptools. Then easy_install pip from terminal, and try again.
I am not sure if this will suffice, but it will be a step at least.

Cannot install netCDF4 python package on OS X

I'm trying to install netCDF4 on OS X with pip install netCDF4 and I am getting the following error:
------------------------------------------------------------
/usr/local/bin/pip run on Wed Aug 7 23:02:37 2013
Downloading/unpacking netCDF4
Running setup.py egg_info for package netCDF4
HDF5_DIR environment variable not set, checking some standard locations ..
checking /Users/mc ...
checking /usr/local ...
checking /sw ...
checking /opt ...
checking /opt/local ...
checking /usr ...
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/var/folders/jj/0w0dd3n16jq4g5579g6c7h040000gn/T/pip-build/netCDF4/setup.py", line 114, in <module>
raise ValueError('did not find HDF5 headers')
ValueError: did not find HDF5 headers
Complete output from command python setup.py egg_info:
HDF5_DIR environment variable not set, checking some standard locations ..
checking /Users/mc ...
checking /usr/local ...
checking /sw ...
checking /opt ...
checking /opt/local ...
checking /usr ...
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/var/folders/jj/0w0dd3n16jq4g5579g6c7h040000gn/T/pip-build/netCDF4/setup.py", line 114, in <module>
raise ValueError('did not find HDF5 headers')
ValueError: did not find HDF5 headers
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /var/folders/jj/0w0dd3n16jq4g5579g6c7h040000gn/T/pip-build/netCDF4
Exception information:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main
status = self.run(options, args)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 256, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 1042, in prepare_files
req_to_install.run_egg_info()
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 236, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/util.py", line 612, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /var/folders/jj/0w0dd3n16jq4g5579g6c7h040000gn/T/pip-build/netCDF4
I already installed HDF5 to /usr/local/hdf5/ but I'm still getting the same error. I'm a new to Python so any help will be greatly appreciated.
Thank you.
You might need to set the HDF5_DIR environment variable to the location where you install HDF5; it's looking in the standard install paths and not finding the headers for HDF5 - hence at least one of your errors.
You can simply set it before calling pip:
HDF5_DIR=/usr/local/hdf5 pip install netCDF4
or export it and then call pip:
export HDF5_DIR=/usr/local/hdf5
pip install netCDF4
Simply try this procedure to install netCDF4
install HDF5 from link
install netcdf4 from link
install netcdf4-python from link
For detail visit link
If you don't need the latest version --prefer-binary flag to pip may solve it:
pip install netcdf4 --prefer-binary

Categories