Python Forum
Troubleshooting site packages ('h5py' to be specific) - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Troubleshooting site packages ('h5py' to be specific) (/thread-30710.html)



Troubleshooting site packages ('h5py' to be specific) - aukhare - Nov-02-2020

Hello!

I want to install the 'h5py' package so I can view the contents of the '.h5' files that I have. I did pip install h5py2.10.0 and that installed the package successfully in my \Python\Lib\site-packages directory. I also added this directory in my path in Windows. But when I used the command import h5py in my script, I got an error saying "No module by the name h5py'. When I typed h5py --version I again got the error saying its not a recognized internal or external command.
Any ideas what I may be doing wrong?

Thanks!


RE: Troubleshooting site packages ('h5py' to be specific) - Larz60+ - Nov-02-2020

see: https://docs.h5py.org/en/stable/build.html#install


RE: Troubleshooting site packages ('h5py' to be specific) - snippsat - Nov-02-2020

(Nov-02-2020, 02:22 PM)aukhare Wrote: I also added this directory in my path in Windows
You shall not add site-packages to Path,only Python and Scripts root folders.
Look at the basic here stuff here Python 3.8 (3.6-3.7) and pip installation under Windows.
So test python and pip from command line,if trouble look at Fixing Path if needed.
Quick example:
# Test python
λ python -V
Python 3.8.3

# Test pip,will show path to Python version it install to
E:\div_code
λ pip -V
pip 20.2.3 from c:\python38\lib\site-packages\pip (python 3.8)

# Install h5py
E:\div_code
λ pip install h5py
Collecting h5py
  Downloading h5py-3.0.0-cp38-cp38-win_amd64.whl (2.7 MB)
     |████████████████████████████████| 2.7 MB 1.3 MB/s
Requirement already satisfied: numpy>=1.17.5; python_version == "3.8" in c:\python38\lib\site-packages (from h5py) (1.19.0)
Collecting cached-property
  Downloading cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Installing collected packages: cached-property, h5py
Successfully installed cached-property-1.5.2 h5py-3.0.0

# Test that it work
E:\div_code
λ python
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import h5py
>>>
>>> h5py.__version__
'3.0.0'
>>> exit()