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

Error when run 'pg = grace()' on Windows #12

Open
KylinGuo opened this issue May 29, 2023 · 2 comments
Open

Error when run 'pg = grace()' on Windows #12

KylinGuo opened this issue May 29, 2023 · 2 comments

Comments

@KylinGuo
Copy link

Here are the details.

(pymatgen_env) C:\Users\USER>ipython
Python 3.11.2 | packaged by Anaconda, Inc. | (main, Mar 27 2023, 23:35:04) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from pygrace import grace

In [2]: pg = grace()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 1
----> 1 pg = grace()

File C:\ProgramData\Anaconda3\envs\pymatgen_env\Lib\site-packages\pygrace\__init__.py:58, in grace(*args, **kwds)
     56 def grace(*args, **kwds):
     57     from pygrace import interactive
---> 58     return interactive.session(*args, **kwds)

File C:\ProgramData\Anaconda3\envs\pymatgen_env\Lib\site-packages\pygrace\interactive\__init__.py:18, in grace(*args, **kwds)
     16 def grace(*args, **kwds):
     17     from .session import grace as graceFactory
---> 18     return graceFactory(*args, **kwds)

File C:\ProgramData\Anaconda3\envs\pymatgen_env\Lib\site-packages\pygrace\interactive\session.py:46, in grace.__init__(self, *args, **kwds)
     44 def __init__(self, *args, **kwds):
     45     from .project import Project
---> 46     self.session = Project(*args, **kwds)
     47     self.whos = {}
     48     self.reserved = ['and','assert','break','class','continue','def','del',
     49                      'elif','else','except','exec','finally','for','from',
     50                      'global','if','import','in','is','lambda','not','or',
     51                      'pass','print','raise','return','try','while','yield',
     52                      'as','None']

File C:\ProgramData\Anaconda3\envs\pymatgen_env\Lib\site-packages\pygrace\interactive\project.py:73, in Project.__init__(self, *args, **kwds)
     72 def __init__(self, *args, **kwds):
---> 73     self.grace = process.Process(*args, **kwds)
     74     self.g = [ Graph(self.grace, 0) ]
     75     self.curr_graph = self.g[0]

File C:\ProgramData\Anaconda3\envs\pymatgen_env\Lib\site-packages\pygrace\interactive\process.py:83, in Process.__init__(self, bufsize, debug, fixedsize, ask, safe, batch, project)
     80         com = com + ('-batch', self.batch)
     82 # Don't exit when xmgrace exits (e.g. user clicks `exit')
---> 83 signal.signal(signal.SIGCHLD, signal.SIG_IGN)
     85 # Create a numbered pipe used for communication to xmgrace
     86 (fd_r, fd_w) = os.pipe()

AttributeError: module 'signal' has no attribute 'SIGCHLD'
@KylinGuo
Copy link
Author

This problem is encountered on Windows 11 and I am using the latest conda (version: 23.5.0). It works well on Ubuntu 22.04.

@mmckerns
Copy link
Member

Apparently there's no SIGCHLD on Windows. https://stackoverflow.com/questions/9217401/sigchld-replacement-for-windows

@mmckerns mmckerns changed the title Error when run 'pg = grace()' in ipython Error when run 'pg = grace()' on Windows May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants