Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Missing parentheses in call to 'print'." #25

Open
ALANLI0258 opened this issue Sep 12, 2020 · 12 comments
Open

"Missing parentheses in call to 'print'." #25

ALANLI0258 opened this issue Sep 12, 2020 · 12 comments

Comments

@ALANLI0258
Copy link

Hello! I have just installed the packages as the README file mentioned. I type "python auto_martini" to test, but it seems that your code is based on python 2. My environment is anaconda 2. Could you help me about this? Thank you!
捕获

@tbereau
Copy link
Owner

tbereau commented Sep 14, 2020 via email

@ALANLI0258
Copy link
Author

Hi, the dev branch should be compatible with Python 3.

On Sat 12 Sep 2020 at 06:58, ALAN LI @.***> wrote: Hello! I have just installed the packages as the README file mentioned. I type "python auto_martini" to test, but it seems that your code is based on python 2. My environment is anaconda 2. Could you help me about this? Thank you! [image: 捕获] https://user-images.githubusercontent.com/49156229/92988622-d116ed80-f4ff-11ea-8ae6-0e770b2f46aa.GIF — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#25>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGE2MRCK3VYXMJVWF3ZZKDSFMEXNANCNFSM4RJCNICQ .

Really sorry. I still have some problems. When I type python auto_martini --smi "N1=C(N)NN=C1N" --mol GUA, it shows:
Traceback (most recent call last): File "auto_martini", line 1389, in <module> cg_molecule(mol, args.molname, args.aa, args.cg, args.forcepred) File "auto_martini", line 1270, in cg_molecule ring_atoms_flat) File "auto_martini", line 507, in find_bead_pos heavyatom_coords, list_heavy_atoms, list_bonds): File "auto_martini", line 582, in all_atoms_in_beads_connected num_atoms = voronoi.values().count(voronoi[list_heavyatoms.index(cg_bead)]) AttributeError: 'dict_values' object has no attribute 'count'

Is the code on github is the latest version? Thank you!!!!

@kkanekal
Copy link
Collaborator

Please clearly state a) the version of Python you are using. b) the branch of the auto-martini code you are using. The error message which you posted suggests that you are still using the master branch rather than switching to the dev branch, as was recommended by Tristan.

@ALANLI0258
Copy link
Author

I see I used the master branch previously, and I found the dev branch. However, how can I run the dev branch after the packages have been installed?

@kkanekal
Copy link
Collaborator

The dev branch has its own readme file that gives instructions on how to use the code. Please follow these instructions and try the GUA example as specified there.

@ALANLI0258
Copy link
Author

I have tried added all the packages. However, I type python -m auto_martini test. The screen showed C:\Users\alanl\Anaconda3\python.exe: No module named auto_martini. Thank you!

@ALANLI0258
Copy link
Author

Really, thank you! I can run auto_martini!!

@mlhossen
Copy link

@ALANLI0258
What have you done after getting "C:\Users\alanl\Anaconda3\python.exe: No module named auto_martini" this message to run auto_martini successfully? I am having the same problem. Anyway, do we need to install auto_martini also? I didn't find anything says like thins in the README file.

@ALANLI0258
Copy link
Author

@ALANLI0258
What have you done after getting "C:\Users\alanl\Anaconda3\python.exe: No module named auto_martini" this message to run auto_martini successfully? I am having the same problem. Anyway, do we need to install auto_martini also? I didn't find anything says like thins in the README file.

please use the dev version.

@mlhossen
Copy link

@ALANLI0258
I have tried both dev and master branch. But in dev branch folder I can't see any auto_martini file. Is there anything I am missing? Like other dependencies, do I need to install auto_martini also? or it is just a script to run? Actually, I am first in python, so you find a few of the questions are very basic. Sorry about that. Any help would be highly appreciated.

@ALANLI0258
Copy link
Author

@ALANLI0258
What have you done after getting "C:\Users\alanl\Anaconda3\python.exe: No module named auto_martini" this message to run auto_martini successfully? I am having the same problem. Anyway, do we need to install auto_martini also? I didn't find anything says like thins in the README file.

please use the dev version.

No worries! It’s been a long time, I don’t remember clearly. You may try run "python setup.py".

@maojinyuan
Copy link

Hi, @tbereau @ALANLI0258
I still counter the same problem, so I change to use the dev version in python3 environment, but the website of full documentation seem to not work(https://tbereau.github.io/auto_martini/docs/html/index.html), so I just didn't how to install it?

@tbereau
Copy link
Owner

tbereau commented Jan 14, 2021

@maojinyuan I've edited the README of the dev branch. Make sure you've installed cython (for instance using pip). Then run:

python setup.py install

that should do it.

@mlhossen
Copy link

@tbereau,
I am using dev branch of auto-martini and python3. I installed Cython also as you recommended. After I run python3 setup.py install, all the dependencies have been processed and showed the following line at the end of the process:
Finished processing dependencies for auto-martini==0.0.2
However, still I can't see any auto_amrtini file generated inside the dev folder. I'm asking because the following command requires this file:
python -m auto_martini [mode] [options].
How can I get the auto_martini file?

@HumanOsv
Copy link

Hello
If you are using python 3 or higher versions, the solution to the problem of:

AttributeError: 'dict_values' object has no attribute 'count'

is as follows:

num_atoms = voronoi.values().count(voronoi[list_heavyatoms.index(cg_bead)])

You only need to convert the "view" into a list, simply wrap voronoi.values() in a list():

num_atoms = list(voronoi.values()).count(voronoi[list_heavyatoms.index(cg_bead)])

Regards - Osvaldo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants