How can I install h5py with Portable Python v2.7?

隐身守侯 提交于 2019-12-13 04:49:37

问题


I am doing some Python 2.7 development work on multiple computers, on some of which I do not have rights to install software. Thus, I am using Portable Python. One of the packages I need to use is h5py; however, since Portable Python installs without modifying the registry, the h5py installer doesn't see it as a valid Python installation. Also, simply extracting the h5py source to a custom F:\py\include folder and adding F:\py\include to the PYTHONPATH environment variable doesn't work, as import h5py results in an ImportError: Cannot import name _errors exception.

How do I install h5py with Portable Python 2.7?


回答1:


  1. Install Python 2.7 onto a computer for which you have sufficient administrative rights.
  2. Install the appropriate version of h5py into this Python installation.
  3. Find the h5py subfolder within the Python install (typically .\Lib\site-packages\h5py) and copy it to the F:\py\include folder mentioned (make sure to add F:\py\include to PYTHONPATH). See my answer here for more details.
  4. Uninstall the 'official' version of Python, if desired.


来源:https://stackoverflow.com/questions/30179534/how-can-i-install-h5py-with-portable-python-v2-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!