我正在尝试用python开发一个GUI,用于分析可以在Linux和Windows中运行的tRNA Seq数据。为此,需要运行一些程序,如:bowtie2、samtools或bedtools,anaconda可以在Linux上轻松下载这些程序,但在Windows上却让人头疼。这个程序无法在Windows上下载,所以我必须安装Windows Linux子系统(WSL),并尝试通过这种方式下载
为此,我开发了以下python脚本(anaconda_setup.py):
import os
#Download the file for Linux, altough this script will run only on Windows Subsystem for Linux
os.system('curl -O https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh')
#Checking the integrity of the file
os.system('sha256sum Anaconda3-2020.07-Linux-x86_64.sh')
#Running the .sh script
os.system('bash Anaconda3-2020.07-Linux-x86_64.sh')
#Compiling from source
os.system('source ~/.bashrc')
os.system('Anaconda3-2020.07-Linux-x86_64.sh')
#Using conda to install bowtie2, samtools and bedtools
os.system('conda install -c bioconda bowtie2')
os.system('conda install -c bioconda samtools')
os.system('conda install -c bioconda bedtools')
然后我在主脚本中使用以下代码调用另一个脚本:
import os
...
os.system("wsl python3 anaconda_setup.py")
有了它,anaconda安装正确了,但我不确定它是安装在windows还是WSL上。但我得到了下一个错误:
sh:1:源:未找到 sh:1:conda:找不到 sh:1:conda:找不到 sh:1:conda:找不到
另一方面,我已经从CMD输入了WSL,我可以手动运行conda.exe和conda,但我不能自动运行。此外,从CMD中,我无法运行:“wsl conda”(错误:/bin/bash:conda:command not found),但我可以运行wsl conda.exe而没有任何问题
你知道我做错了什么,或者我该怎么解决这个问题吗
多谢各位
使用Linux anaconda安装程序为wsl2安装anaconda
检查
conda
命令是否运行,如果未运行,则必须在.bashrc
文件中导出路径再次运行
conda
,它现在可以工作了。您可以在wsl2中使用conda安装所需的软件希望这对你有所帮助。欲了解更多信息,请访问此 post
以下是您可以遵循的步骤
sudo apt install wget
安装wgetwget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
export PATH=~/miniconda3/bin:$PATH
conda install -c bioconda bowtie2
相关问题 更多 >
编程相关推荐