microsoft / Elevation

End-to-end guide design for CRISPR/Cas9 with machine learning
MIT License
127 stars 35 forks source link

Internal python error when running guideseq.py #1

Closed sarahet closed 6 years ago

sarahet commented 6 years ago

Hi all,

I tried to install Elevation but when running guideseq.py after the 7th search run I receive this error message:

SEARCH run completed in 0:40:57.519508
Traceback (most recent call last):
  File "guideseq.py", line 34, in <module>
    om.write_hdf5()
  File "./offtarget_manager.py", line 104, in write_hdf5
    data = utils.read_dsnf(filename).rename(index=str, columns={
AttributeError: 'module' object has no attribute 'read_dsnf'

Could someone help me figure out the problem? Do I need a specific version of some module that I have not been able to figure out so far? Thanks for any comments and help!

jjc2718 commented 6 years ago

Hi - I'm not able to reproduce this on my system (I went through the installation steps on both Linux and Windows), but I'll try to help you debug.

Could you comment out line 31 ("om.execute_commands()") in guideseq.py, and add the line print utils.__file__ to offtarget_manager.py (in the dsNickFury3PlusOrchid directory) underneath the import utils line, then rerun guideseq.py?

Commenting out the line will prevent you from running the search again, and the print statement should print the location of the utils.py file in dsNickFury3PlusOrchid - my best guess is that you're importing a different utils module by accident.

sarahet commented 6 years ago

I get the path from the site-package in my ./local/lib/python3.6/site-packages/utils/ folder. Where should it include the module from?

jjc2718 commented 6 years ago

It should include the module in the dsNickFury/dsNickFury3PlusOrchid directory. Based on your answer, it does look like a naming conflict with a different Python package.

As a short-term fix, try changing sys.path.append('./') on line 11 of guideseq.py to sys.path.insert(1, './'), and remove the print statement in offtarget_manager.py. This will allow the local version of utils to take priority. Let me know if you run into any issues once you make this change and rerun guideseq.py.

Longer term, we should probably change the name of utils to something more specific to avoid this problem. I'll put in a pull request to dsNickFury to change this.

sarahet commented 6 years ago

I changed everything as recommended but get the following error message

Traceback (most recent call last):
  File "guideseq.py", line 13, in <module>
    from offtarget_manager import OfftargetManager
  File "./offtarget_manager.py", line 7, in <module>
    import utils
  File "./utils.py", line 3, in <module>
    import azure.storage.table
  File "/home/hetzel/.local/lib/python2.7/site-packages/azure/storage/__init__.py", line 21, in <module>
    from .models import (
  File "/home/hetzel/.local/lib/python2.7/site-packages/azure/storage/models.py", line 27, in <module>
    from cryptography.hazmat.primitives.keywrap import(
  File "/home/hetzel/.local/lib/python2.7/site-packages/cryptography/hazmat/primitives/keywrap.py", line 12, in <module>
    from cryptography.hazmat.primitives.constant_time import bytes_eq
  File "/home/hetzel/.local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py", line 9, in <module>
    from cryptography.hazmat.bindings._constant_time import lib
ImportError: /home/hetzel/.local/lib/python2.7/site-packages/_cffi_backend.so: undefined symbol: PyUnicodeUCS2_FromUnicode

Do you have any idea what the problem could be here? Thanks for your help so far!

jjc2718 commented 6 years ago

I'm not sure what that particular problem is, but try commenting out the azure.storage.table and azure.storage.blob imports in utils.py - they shouldn't be needed for this script.

sarahet commented 6 years ago

It seems that it is needed but I found the problem, it was a broken package. Thank you very much for your help.