Python Forum
Troubleshooting site packages ('h5py' to be specific)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Troubleshooting site packages ('h5py' to be specific)
#1
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!
Reply
#2
see: https://docs.h5py.org/en/stable/build.html#install
Reply
#3
(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()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  OBS Script Troubleshooting Jotatochips 0 305 Feb-10-2024, 06:18 PM
Last Post: Jotatochips
  Troubleshooting with PySpy Positron79 0 812 Jul-24-2022, 03:22 PM
Last Post: Positron79
  site-packages issue paulgureghian 3 1,365 Jul-07-2022, 04:15 PM
Last Post: snippsat
  site packages, python 3.8 Dixon 12 6,493 Feb-01-2020, 05:32 PM
Last Post: Dixon
  Site packages, Python 3.8 Dixon 2 2,523 Jan-18-2020, 10:42 PM
Last Post: Dixon
  Delete specific lines contain specific words mannyi 2 4,152 Nov-04-2019, 04:50 PM
Last Post: mannyi
  Troubleshooting simple script and printing class objects Drone4four 11 8,207 Dec-16-2017, 05:12 AM
Last Post: Drone4four

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020