解决安装bioservices包报错

2022-10-03  本文已影响0人  Yayamia

报错:

(base) [myh@bogon ~]$ pip3.9 install bioservices
Defaulting to user installation because normal site-packages is not writeable
Collecting bioservices
  Using cached bioservices-1.10.3.tar.gz (197 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-4blslu52/bioservices_34eade18bd69468a9c4a696b661f69e1/setup.py", line 51, in <module>
          with open('requirements.txt', 'r') as f:
      FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

解决方法:
手动下载包的源文件并解压tar.gz
cd到setup.py的路径,发现没有requirements.txt的文件
/home/user/myh/bioservices-1.10.3/src/bioservices.egg-info中找到了requires.txt文件
重命名为requirements.txt并放在setup.py所在路径

报错应该是一个list--删除txt中[test]及下面的内容--pip3.9 install requirements.txt

安装好依赖后,报错没有权限到XXX的安装路径(即默认安装路径在root路径中)。

自定义默认安装路径:
python3.9 setup.py install --root /home/user/myh --prefix /home/user/myh/.local/lib/python3.9/site-packages

安装成功

上一篇 下一篇

猜你喜欢

热点阅读