我正在尝试用python开发一个GUI来分析tRNA-Seq数据,它可以在Linux和Windows上运行。为此,需要运行一些程序,如: bowtie2,samtools或bedtools,这些程序在Linux上可以很容易地通过anaconda下载,但在Windows上却令人头疼。这个程序不能在Windows上下载,所以我不得不安装Windows Subsystem for 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:未找到
另一方面,我已经从CMD进入WSL,我可以手动运行conda.exe和conda,但我不能自动运行。此外,从命令驱动我不能运行:"wsl conda“(错误: /bin/bash: conda:命令未找到),但我可以运行wsl conda.exe没有任何问题。
你知道我做错了什么吗?或者我该怎么解决这个问题?
非常感谢。
发布于 2021-05-08 16:17:03
使用用于anaconda的Linux安装程序安装用于wsl2的anaconda
wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.9.2-Linux-x86_64.sh检查conda命令是否运行,如果没有,必须将路径导出到.bashrc文件中
export PATH=/home/user/anaconda3/bin:$PATH再次运行conda,它现在就可以工作了。您可以在wsl2中使用conda安装所需的软件。
希望这能帮到你。有关更多信息,请访问此post
发布于 2021-05-09 00:03:27
以下是您可以遵循的步骤。
sudo apt install wget安装
conda install -c bioconda bowtie2的wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
export PATH=~/miniconda3/bin:$PATH
https://stackoverflow.com/questions/65379652
复制相似问题