question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Windows Support]module 'os' has no attribute 'getpgid'

See original GitHub issue

When running env.reset(), I encounter this error:

Initializing new Carla server...                                                                                        
FATAL ERROR while launching server: <class 'AttributeError'>                                                            
Error during reset: Traceback (most recent call last):                                                                    
File "C:\Eer Kai Jun\Autonomous Driving\env\lib\site-packages\macad_gym\carla\multi_env.py", line 579, in reset         self._init_server()                                                                                                   
File "C:\Eer Kai Jun\Autonomous Driving\env\lib\site-packages\macad_gym\carla\multi_env.py", line 475, in _init_server                                                                                                                            live_carla_processes.add(os.getpgid(self._server_process.pid))                                                      
AttributeError: module 'os' has no attribute 'getpgid'

I think this is because the os library does not support the getpgid function in windows. Are they any workarounds for this issue?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
eerkaijuncommented, Feb 22, 2021

Hi @praveen-palanisamy, yeap that solves the problem! Thanks a lot for the help!

0reactions
praveen-palanisamycommented, Feb 18, 2021

Ohh. Okay. Yeah, the setsid is also not available on Windows. I unfortunately don’t yet have a Windows machine setup to test this out now. The solution is to remove the preexec_fn=os.setsid argument to Popen. I have update my comment above(https://github.com/praveen-palanisamy/macad-gym/issues/32#issuecomment-779564218) to include this change as well for Windows support. Please give it a try with this change and post what you find.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: module 'os' has no attribute 'geteuid' · Issue #889
Windows support in repo2docker is "low", mostly because it is hard and because none of the devs have access to a windows machine....
Read more >
Python os.geteuid() for windows - Stack Overflow
User id in Windows? I'm not sure getpass is what you want. import getpass getpass.getuser() >>> 'HelloWorld'. But be careful, the function ...
Read more >
16.1. os — Miscellaneous operating system interfaces
All functions in this module raise OSError in the case of invalid or inaccessible file names and paths, or other arguments that have...
Read more >
15.1. os — Miscellaneous operating system interfaces - Jython
The file has no directory entries associated with it and will be automatically deleted once there are no file descriptors for the file....
Read more >
Python Examples of os.killpg - ProgramCreek.com
if not m2ee.stop(): if not m2ee.terminate(): m2ee.kill() try: this_process = os.getpgid(0) logging.debug( "Terminating process group with pgid=%s", ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found