最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Arnie (RNA Folding) Not Detecting ViennaRNA Even After Modifying utils.py - Stack Overflow

programmeradmin0浏览0评论

I'm trying to use the Arnie Python package for RNA folding with ViennaRNA and LinearFold. However, even after modifying utils.py to include debugging statements and manually add ViennaRNA, Arnie does not detect vienna_2. I have verified several times that ViennaRNA is downloaded. This is on Linux, and I am utilizing nano and python as well.

  1. Confirmed ViennaRNA is Installed

Inputs (bash):

ls -l /home/vboxuser/miniconda3/envs/rna_env/bin/RNAfold
/home/vboxuser/miniconda3/envs/rna_env/bin/RNAfold --version

Outputs:

RNAfold 2.7.0

This confirms ViennaRNA is installed and executable.

  1. Checked if Arnie is Using the Correct utils.py Input (bash):
python -c "import arnie.utils; print(arnie.utils.__file__)"

Output:

/home/vboxuser/miniconda3/envs/rna_env/lib/python3.9/site-packages/arnie/utils.py

I am modifying the correct file.

  1. Modified utils.py to Add Debugging Statements
/home/vboxuser/miniconda3/envs/rna_env/lib/python3.9/site-packages/arnie/utils.py, 

I modified load_package_locations() as follows:

Input (python):

import os

def load_package_locations():
    package_locs = {}

    # Debugging ViennaRNA
    vienna_path = "/home/vboxuser/miniconda3/envs/rna_env/bin/RNAfold"
    print(f"DEBUG: Checking ViennaRNA path: {vienna_path}")

    if os.path.exists(vienna_path):
        package_locs["vienna_2"] = vienna_path
        print("DEBUG: ViennaRNA detected!")
    else:
        print("DEBUG: ViennaRNA NOT found!")

    eterna_path = "/home/vboxuser/miniconda3/envs/rna_env/bin/eternafold"
    if os.path.exists(eterna_path):
        package_locs["eternafold"] = eterna_path

    print("DEBUG: Package locations detected:", package_locs)

    return package_locs

Saved the file (Ctrl + X → Y → Enter) and restarted Python.

  1. Forced Python to Reload utils.py Tried forcing Python to reload utils.py:

Input (python)

import importlib
import arnie.utils
importlib.reload(arnie.utils)

from arnie.utils import load_package_locations
print(load_package_locations())

❌ But the debugging statements NEVER appear. ❌ vienna_2 is still missing from the output.

  1. Deleted Python Cache (pycache)

Input (bash)

rm -rf /home/vboxuser/miniconda3/envs/rna_env/lib/python3.9/site-packages/arnie/__pycache__/

Then restarted Python, but still no changes.

  1. Reinstalled Arnie Completely and deleted all remaining files

Input(bash):

pip uninstall arnie

rm -rf /home/vboxuser/miniconda3/envs/rna_env/lib/python3.9/site-packages/arnie/

Reinstalled (bash)

pip install --no-cache-dir arnie

Re-modified utils.py to add vienna_2 manually, but Python still does not detect it.

发布评论

评论列表(0)

  1. 暂无评论