gpt4 book ai didi

python - 在 Ubuntu 14.04.02 上使用 pip 安装 Fuel(机器学习)

转载 作者:行者123 更新时间:2023-12-04 19:17:13 24 4
gpt4 key购买 nike

安装 Fuel machine learning 时库,我遇到了一些依赖问题:

alvas@ubi:~$ pip install --upgrade git+git://github.com/mila-udem/fuel.gitYou are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting git+git://github.com/mila-udem/fuel.git
Cloning git://github.com/mila-udem/fuel.git to /tmp/pip-xUlqCT-build
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Collecting numpy (from fuel==0.0.1)
Requirement already up-to-date: six in /usr/local/lib/python2.7/dist-packages (from fuel==0.0.1)
Collecting picklable-itertools (from fuel==0.0.1)
Downloading picklable-itertools-0.1.1.tar.gz
Collecting pyyaml (from fuel==0.0.1)
Downloading PyYAML-3.11.tar.gz (248kB)
100% |████████████████████████████████| 249kB 612kB/s
Collecting h5py (from fuel==0.0.1)
Downloading h5py-2.5.0.tar.gz (684kB)
100% |████████████████████████████████| 688kB 398kB/s
Collecting tables (from fuel==0.0.1)
Downloading tables-3.2.2.tar.gz (7.0MB)
100% |████████████████████████████████| 7.0MB 73kB/s
Complete output from command python setup.py egg_info:
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
* Using Python 2.7.6 (default, Jun 22 2015, 17:58:13)
* USE_PKGCONFIG: True
.. ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the ``HDF5_DIR`` environment
variable or by using the ``--hdf5`` command-line option.

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wMS1d3/tables

然后在我完成之后( Installing h5py on an Ubuntu server ):
sudo apt-get install libhdf5-dev
sudo HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ pip install h5py

然后我还必须更新我的cython:
sudo pip install cython

我的问题不是关于如何解决安装问题,而是 这个命令是什么意思?
sudo HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ pip install h5py

指定 HDF5_DIR 有什么作用?

为什么燃料依赖项没有自动从 安装? :
  • https://github.com/mila-udem/fuel/blob/master/requirements.txt
  • https://github.com/mila-udem/fuel/blob/master/setup.py

  • 我应该怎么做才能从 fuel 更新 setup.py以便它可以自动 pip 安装依赖项?

    最佳答案

    您无需对 中的 setup.py 进行任何修改燃料 .只需确保在更新库之前正确设置了 HDF5_DIR。

    说明:

    如果您查看您的错误日志,您会发现它在安装 时失败了。 h5py python lib,它是 的依赖项燃料 .最后也告诉你为什么失败了,基本上是因为 h5py 使用 C 库 hdf5,它需要这个库的头文件才能使用它。
    所以sudo apt-get install libhdf5-dev您执行的是安装此 C 库的开发版本(您可以通过 -dev 猜测)。开发版本安装 lib 的头文件,而不仅仅是编译的 lib。
    然后,需要 HDF5_DIR 环境变量来告诉 h5py 设置在哪里可以找到这些 header 。

    因此,如果您下次要更新燃料库,请确保 HDF5_DIR 设置正确,然后它将更新其依赖项(包括 h5py)。

    关于python - 在 Ubuntu 14.04.02 上使用 pip 安装 Fuel(机器学习),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33209048/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com