jvermaas / LigninBuilder

VMD Plugin and associated scripts to build lignin structures from topological specifications
13 stars 4 forks source link

Error while running the package #11

Open alimirzaalian opened 4 months ago

alimirzaalian commented 4 months ago

Dear Developers,

Thanks for sharing your useful code. I tried several times to run your package to build a lignin, but I always get this error. I am not an expert on Python codes and libraries. I followed the step-by-step installation part, and I did it without issue. Once I try to execute the create_lignin or create_lignin -h, I get this error. I appreciate it if you give me your helpful comments on it to fix this issue. " File "C:\Users\Ali Mirzaalian.conda\envs\lignin-kmc\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Users\Ali Mirzaalian.conda\envs\lignin-kmc\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\Ali Mirzaalian.conda\envs\lignin-kmc\Scripts\create_lignin.exe_main.py", line 4, in File "C:\Users\Ali Mirzaalian.conda\envs\lignin-kmc\lib\site-packages\ligninkmc\create_lignin.py", line 15, in from common_wrangler.common import (MAIN_SEC, GOOD_RET, INPUT_ERROR, KB, H, KCAL_MOL_TO_J_PART, ImportError: cannot import name 'H' from 'common_wrangler.common' (C:\Users\Ali Mirzaalian.conda\envs\lignin-kmc\lib\site-packages\common_wrangler\common.py)"

Even using your KMCdemo. When I run the first step, I get this error: Traceback (most recent call last): File "C:\Users\Ali Mirzaalian\Downloads\Compressed\LigninBuilder-master\LigninKMCdemo\step1.py", line 4, in from ligninkmc.kmc_functions import (run_kmc, generate_mol, gen_tcl) ModuleNotFoundError: No module named 'ligninkmc'

Bests, Ali

jvermaas commented 4 months ago

Did you install ligninkmc? If so, how? That is what what the last log is complaining about, since for whatever reason it can't find the ligninkmc module. I dunno about the top one, but those error messages look like what you'd get with a goofy install.

alimirzaalian commented 4 months ago

Yes, I installed the lignin kmc following the instructions as it is in : https://github.com/michaelorella/lignin-kmc I installed it, and a new environment called lignin-kmc was created in Anaconda. Then I open the terminal in this environment, as navigated to the folder of lignin-kmcdemo ( which you have provided) in the ligninbuilder folder. Then I followed the instruction provided by you, and run : python3 step1.py, but I gave this error: (lignin-kmc) C:\Users\Ali Mirzaalian\Downloads\Compressed\LigninBuilder-master\LigninKMCdemo>python3 step1.py Traceback (most recent call last): File "C:\Users\Ali Mirzaalian\Downloads\Compressed\LigninBuilder-master\LigninKMCdemo\step1.py", line 4, in from ligninkmc.kmc_functions import (run_kmc, generate_mol, gen_tcl) ModuleNotFoundError: No module named 'ligninkmc' I am really confused as I try to run this plugin many time, while I could not.

jvermaas commented 4 months ago

I dunno what to say. I see you also have an issue open with ligninkmc. Based on your file paths, it looks like you are using windows, and I don't have a windows machine on which to test. Are you able to run the ligninkmc tests? https://github.com/michaelorella/lignin-kmc/tree/master/tests

jvermaas commented 4 months ago

Hi @alimirzaalian , try the following:

Install an old version of ligninkmc to get dependencies

pip3 install ligninkmc --user pip3 uninstall ligninkmc

Get the current version from github, and install it.

git clone https://github.com/michaelorella/lignin-kmc.git cd lignin-kmc python3 setup.py install --user

The initial issue you were getting was that common_wrangler has had some updates to change internal variable names. The git version of lignin-kmc has fixes for this, but the pip package doesn't (yet).

alimirzaalian commented 3 months ago

Hi, @jvermaas! Thanks for your following up. Basically, I tried to install it on ubuntu using WSL. I did what you have said. But, this error arises: Traceback (most recent call last): File "/home/ali/lignin-kmc/lignin-kmc/setup.py", line 8, in from setuptools import setup ModuleNotFoundError: No module named 'setuptools'

Thanks in advance, Ali

jvermaas commented 3 months ago

You might need to pip install setuptools? Admittedly, I haven't ever run into this error where setup.py does not run, so this might not be accurate, but the usual way to get around a module not found error is to install the module.