【问题标题】:installing openbabel with pip for linux in venv在 venv 中使用 pip for linux 安装 openbabel
【发布时间】:2020-09-07 02:02:53
【问题描述】:

我正在尝试将openbabelpip 安装在没有root 访问权限且使用虚拟环境的Linux 计算机上。我运行以下命令

pip install openbabel --user --log LOG

然后我得到以下错误:

Collecting openbabel
  Using cached openbabel-2.4.1.tar.gz (74 kB)
Building wheels for collected packages: openbabel
  Building wheel for openbabel (setup.py) ... error
  ERROR: Failed building wheel for openbabel
  Running setup.py clean for openbabel
Failed to build openbabel
Installing collected packages: openbabel
    Running setup.py install for openbabel ... error
ERROR: Command errored out with exit status 1: /users/name/env_for_pymatgen/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-b51wnefv/openbabel/setup.py'"'"'; __file__='"'"'/tmp/pip-install-b51wnefv/openbabel/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-4207icvx/install-record.txt --single-version-externally-managed --compile --install-headers /users/name/env_for_pymatgen/include/site/python3.6/openbabel Check the logs for full command output.

主要问题似乎是

Error: SWIG failed. Is Open Babel installed?
    You may need to manually specify the location of Open Babel include and library directories. For example:
      python setup.py build_ext -I/usr/local/include/openbabel-2.0 -L/usr/local/lib
      python setup.py install

我看到很多人对setup.py 有类似的问题,建议他们转到该目录并再次运行相同的命令,但我不知道我应该转到哪个目录...

编辑

如果我从github下载openbabel并给出它的路径,它会工作吗?

【问题讨论】:

标签: python linux pip python-venv openbabel


【解决方案1】:

根据我的经验,不要从pip install <package_name> 下载一个wheel 文件,而是从here 下载一个由PyPI 上的源代码构建的python 二进制文件。

之后,打开您下载.whl文件的终端,然后输入:

pip install nameOfYourFile.whl

在我的情况下是:

pip install openbabel-3.1.1-cp38-cp38-win32.whl

编辑:请务必下载与您的 python 版本匹配的版本,否则该软件包将无法安装。

【讨论】:

    猜你喜欢
    • 2020-01-12
    • 1970-01-01
    • 1970-01-01
    • 2019-06-01
    • 2021-04-08
    • 2022-10-18
    • 2018-06-17
    • 1970-01-01
    • 2016-03-20
    相关资源
    最近更新 更多