为什么R库'ssw'不能找到通过pip3安装的python模块,尽管可以满足pip3模块的安装要求? [英] Why R library 'ssw' cannot find python module installed via pip3, although pip3 module installation is satisfied?

查看:61
本文介绍了为什么R库'ssw'不能找到通过pip3安装的python模块,尽管可以满足pip3模块的安装要求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ubuntu 20.04.1 LTS焦点上,并使用 R .我想在R中安装一个库,以通过Smith-Waterman算法但通过更快的实现来执行局部序列比对.

I am on Ubuntu 20.04.1 LTS focal, and using R. I want to install in R a library to perform local sequence alignments based upon the Smith-Waterman algorithm but via a faster implementation.

R 库是 ssw ,可以在这里找到: https://github.com/nanxstats/ssw-r 单击链接到github存储库

The R library is ssw and can be found here: https://github.com/nanxstats/ssw-r click link to github repo

描述: ssw-r为SSW提供了R接口,这是Smith-Waterman算法的快速实现,用于使用SIMD进行序列比对.ssw-r当前基于Python包ssw-py

当我尝试按照README.md步骤安装它时,

When I try to install it following the README.md steps,

  • remotes :: install_github("nanxstats/ssw-r"),可以正常执行
  • reticulate :: use_python("/usr/local/bin/python3"),也可以正常执行
  • library("ssw"),甚至可以很好地加载库
  • "ACGT"%>%align("TTTTACGTCCCCC"),运行示例不会很好地产生此错误:
  • remotes::install_github("nanxstats/ssw-r"), executes fine
  • reticulate::use_python("/usr/local/bin/python3"), also executes fine
  • library("ssw"), loading the library even executes fine
  • "ACGT" %>% align("TTTTACGTCCCCC"), running an example does not execute fine producing this error:
> "ACGT" %>% align("TTTTACGTCCCCC")
Error: Python module ssw was not found.

Detected Python configuration:

python:         /root/.local/share/r-miniconda/envs/r-reticulate/bin/python
libpython:      /root/.local/share/r-miniconda/envs/r-reticulate/lib/libpython3.6m.so
pythonhome:     /root/.local/share/r-miniconda/envs/r-reticulate:/root/.local/share/r-miniconda/envs/r-reticulate
version:        3.6.11 | packaged by conda-forge | (default, Aug  5 2020, 20:09:42)  [GCC 7.5.0]
numpy:          /root/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages/numpy
numpy_version:  1.19.1

我已通过请求将 ssw-py 安装为README.md;

I have installed ssw-py as the README.md requested via;

$ sudo pip3 install ssw-py
Requirement already satisfied: ssw-py in /usr/local/lib/python3.8/dist-packages (0.2.6)

我不确定依赖项有什么问题.第一次在R中安装 ssw 时,系统提示我是否要安装 miniconda ,然后选择是".我没有在系统上安装 anaconda .(在Ubuntu仿生18.04上,我能够成功安装anaconda,无论我尝试对焦多少次都行不通,例如,安装程序最初将其放置在/root/anaconda3中的一个小文件中)

I am not sure what is wrong with the dependencies. When installing ssw in R the first time I was prompted whether I wanted to install miniconda and chose yes. I do not have anaconda installed on the system. (On Ubuntu bionic 18.04 I was able to install anaconda successfully and no matter how many times I tried on focal it would not work, eg the installer originally placed it in /root/anaconda3 in a small file)

要使该库 ssw 正常工作,我需要解决什么问题?

What do I need to fix to get this library ssw to work?

推荐答案

我设法通过在语句 library("ssw"):

Sys.setenv(RETICULATE_PYTHON = "/usr/bin/python3")

README.md reticulate :: use_python("/usr/local/bin/python3")中规定的语句未连接到python安装,并且该命令在我的系统上有效.这是通过以下方式发现的:

The statement prescribed in the README.md reticulate::use_python("/usr/local/bin/python3") did not connect to the python installation and this one works on my system. This was discovered via:

$ which python3
/usr/bin/python3

,然后将此目录用作python连接的系统环境

and then using this directory as the system environment for the python connectivity

这篇关于为什么R库'ssw'不能找到通过pip3安装的python模块,尽管可以满足pip3模块的安装要求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆