prody / ProDy

A Python Package for Protein Dynamics Analysis
http://prody.csb.pitt.edu
Other
433 stars 157 forks source link

TypeError: __import__() argument 1 must be string, not None #141

Closed cuiyoutian closed 12 years ago

cuiyoutian commented 12 years ago

dear friend: When I use NMWiz 1.0 ,prody 1.1 and python 2.7, I come across the error.

Traceback (most recent call last): File "C:/Python27/Lib/site-packages/prody/dynamics/anm.py", line 35, in from gnm import GNMBase, ZERO, checkENMParameters File "C:\Python27\Lib\site-packages\prody\dynamics\gnm.py", line 40, in pkg = import(package) TypeError: import() argument 1 must be string, not None Traceback (most recent call last): File "C:/Python27/Lib/site-packages/prody/dynamics/anm.py", line 35, in from gnm import GNMBase, ZERO, checkENMParameters File "C:\Python27\Lib\site-packages\prody\dynamics\gnm.py", line 40, in pkg = import(package) TypeError: import() argument 1 must be string, not None while executing

would u help me?

abakan-zz commented 12 years ago

Hi,

I don't have this problem in the same setting on Windows and I don't understand why you have it, but the problem is caused by __import__(__package__) statement. I have been removing these statements from the package, but there were still a few. I have removed them all with my recent commit.

What you can do is downloading the package from here and replacing the files in you Python installation. NMWiz and ProDy should then work without problems.

Download: https://github.com/abakan/ProDy/zipball/master Update files in: C:\Python27\Lib\site-packages\prody

Note that the package that you download is under development and implementation of some functions is not finished, but all features that you may need work fine. Let me know if you have any further problems.

cuiyoutian commented 12 years ago

dear abakan, when I update the C:\Python27\Lib\site-packages\prody,and use NMWiz,some errors(CKDTree error) still come out.

Traceback (most recent call last): File "C:/Python27/Lib/site-packages/prody/dynamics/anm.py", line 30, in from prody import LOGGER File "C:\Python27\lib\site-packages\prodyinit.py", line 260, in import kdtree File "C:\Python27\lib\site-packages\prody\kdtreeinit.py", line 22, in from kdtree import KDTree File "C:\Python27\lib\site-packages\prody\kdtree\kdtree.py", line 41, in raise ImportError(str(err)) ImportError: No module named _CKDTree Traceback (most recent call last): File "C:/Python27/Lib/site-packages/prody/dynamics/anm.py", line 30, in from prody import LOGGER File "C:\Python27\lib\site-packages\prodyinit.py", line 260, in import kdtree File "C:\Python27\lib\site-packages\prody\kdtreeinit.py", line 22, in from kdtree import KDTree File "C:\Python27\lib\site-packages\prody\kdtree\kdtree.py", line 41, in raise ImportError(str(err)) ImportError: No module named _CKDTree while executing

abakan-zz commented 12 years ago

You have probably deleted ProDy folder and removed compiled C modules. If you can provide following two files it should work: prody\kdtree\_CKDTree.pyd and prody\proteins\cpairwise2.pyd

You can run windows installer again and update only .py files, or you can extract the contents of windows installer using 7Zip and get above files only into the package.

cuiyoutian commented 12 years ago

sorry to disturb u again,

Traceback (most recent call last): File "C:/Python27/Lib/site-packages/prody/dynamics/anm.py", line 36, in from .gnm import GNMBase, ZERO, checkENMParameters ValueError: Attempted relative import in non-package Traceback (most recent call last): File "C:/Python27/Lib/site-packages/prody/dynamics/anm.py", line 36, in from .gnm import GNMBase, ZERO, checkENMParameters ValueError: Attempted relative import in non-package while executing

perhaps something wrong with my path.

abakan-zz commented 12 years ago

Hmm, are you selecting "C:/Python27/Lib/site-packages/prody/dynamics/anm.py" or "C:/Python27/Lib/site-packages/prody/dynamics/gnm.py" files when VMD is asking you for prody file? You should pick "C:/Python27/scripts/prody`. VMD will say it is not executable but that is the script file that interfaces NMWiz. If this is the case, try and let me know if you continue to have problems.

cuiyoutian commented 12 years ago

thank u,I selected C:/Python27/Lib/site-packages/prody/dynamics/anm.py. after selecting "C:/Python27/scripts/prody`, the problem can be solved.