简体   繁体   中英

Anaconda: “kraken” is not running in my virtual environment despite being installed there

I'm using a fresh install of Kubuntu 19.04. I'm also very new to Python and anaconda, so it's possible the mistake I am making is quite obvious. I am trying to run the OCR program kraken in a virtual environment created through conda, yet when I run any kraken commands ( kraken list kraken get 10.5281/zenodo.2577813 ), I get the following error:

Command 'kraken' not found, but can be installed with:
sudo apt install kraken

I created the virtual environment using the instructions found here :

wget https://raw.githubusercontent.com/mittagessen/kraken/master/environment.yml
conda env create -f environment.yml

I then entered the kraken environment through conda activate kraken , but found that kraken list did not work. I attempted to reinstall kraken through conda install --name kraken kraken . When I use conda list , kraken is listed as an installed package.

I thought the problem might be due to an error in my .bashrc. In my .bashrc, conda had created:

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/USERNAME/Programming/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/USERNAME/Programming/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/USERNAME/Programming/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/USERNAME/Programming/anaconda3/bin:$PATH"
    fi
fi
#unset __conda_setup
# <<< conda initialize <<<

After the error, I commented out the above and changed it to:

. /home/USERNAME/Programming/anaconda3/etc/profile.d/conda.sh
conda activate

That did not fix the problem. Both are at the bottom of my .bashrc. I have not tried moving them to the top.

Again, after each change I attempted kraken list but rather than getting a list of available models, I instead got:

Command 'kraken' not found, but can be installed with:
sudo apt install kraken

Is there another command I am supposed to use to use python programs in conda created environments?

Aditionally: The kraken program that I can install from the Ubuntu repository seems to be a program to categorize DNA, not an OCR program.

I think this Issue , explains it/sums it up. You have to install kraken from the github master branch, and not using conda envs .

Simply:

# Clone the master branch into kraken directory.
$ git clone https://github.com/mittagessen/kraken.git

# And then, Use a virtualenv or just:

$ pip3 install .

This completes the installation of kraken , you can verify it using :

$ kraken list
$ Retrieving model list .✓
10.5281/zenodo.2577813 (pytorch) - A generalized model for English printed text

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM