Feature Idea: Can't create newrelic.ini on Windows with Python

The script to generate the newrelic.ini on Windows, as requested to be run by the docs:

newrelic-admin generate-config newrelic.ini

fails on windows because the module pwd doesn’t exist:

Traceback (most recent call last):
  File "C:\Users\pupeno\Documents\Eligible\code\phoenix\venv\Scripts\newrelic-admin-script.py", line 11, in <module>
    load_entry_point('newrelic==', 'console_scripts', 'newrelic-admin')()
  File "c:\users\pupeno\documents\eligible\code\phoenix\venv\lib\site-packages\setuptools-39.1.0-py3.7.egg\pkg_resources\__init__.py", line 480, in load_entry_point
  File "c:\users\pupeno\documents\eligible\code\phoenix\venv\lib\site-packages\setuptools-39.1.0-py3.7.egg\pkg_resources\__init__.py", line 2691, in load_entry_point
  File "c:\users\pupeno\documents\eligible\code\phoenix\venv\lib\site-packages\setuptools-39.1.0-py3.7.egg\pkg_resources\__init__.py", line 2322, in load
  File "c:\users\pupeno\documents\eligible\code\phoenix\venv\lib\site-packages\setuptools-39.1.0-py3.7.egg\pkg_resources\__init__.py", line 2328, in resolve
  File "c:\users\pupeno\documents\eligible\code\phoenix\venv\lib\site-packages\newrelic\admin\__init__.py", line 143, in <module>
  File "c:\users\pupeno\documents\eligible\code\phoenix\venv\lib\site-packages\newrelic\admin\__init__.py", line 108, in load_internal_plugins
  File "c:\users\pupeno\documents\eligible\code\phoenix\venv\lib\site-packages\newrelic\admin\record_deploy.py", line 3, in <module>
    import pwd
ModuleNotFoundError: No module named 'pwd'

Maybe this can be of some help in finding a solution: https://github.com/gitpython-developers/GitPython/issues/356

  • I want this, too
  • I have more info to share (reply below)
  • I have a solution for this

0 voters

We take feature ideas seriously and our product managers review every one when plotting their roadmaps. However, there is no guarantee this feature will be implemented. This post ensures the idea is put on the table and discussed though. So please vote and share your extra details with our team.

1 Like

@pablo.fernandez1 While some customers may have been able to get the agent working with Windows, the Python agent doesn’t currently officially support Windows environments. You can read more about the Python agent’s compatibility and requirements here:


I’ll make sure to pass along your interest in having Windows support to our Product Developers. We’ll add a poll to your post so others can express their support for having Windows support as well. :slight_smile:


I wasn’t trying to run the agent on windows. My servers are Linux, but I develop on windows. I was trying to generate the newrelic.ini (last time I used New Relic you could just download it from newrelic.com).

BTW, 49% of Python developers use Windows. I tried to link to the survey results that show it, but this web site won’t let me.

Hey @pablo.fernandez1,

I am the product manager for the Python Agent and I appreciate your feedback! I took a look at the JetBrains survey you referenced and acknowledge the need for us to better serve the Python community developing in Windows.

While I can’t promise we’ll prioritize making the config generator work in Windows right away, this is something we’re aware of and will factor into our roadmap.


I personally got it to work by commenting out the requirement of pwd and hardcoding the single use of pwd, so, this bug shouldn’t be too hard to fix. I don’t have any urgency, just letting you know so you can have more information regarding estimating effort.

1 Like

Thanks for sharing your fix here @pablo.fernandez1 - I’m sure @kchu and the Python team will take that on board :smiley:

Same issue with newrelic agent version Commented out the pwd import and was able to run the generate-config command locally (in Windows 10, Python 3.6.8) with no issues. Production environment is Linux so shouldn’t be any issues there.

1 Like

Happy to hear that worked for you @rob.schafer! :slight_smile:

Same issue. Same fix :slight_smile:
Commenting out the pwd import worked (in Windows 10, Python 3.6.8)
Thank you @pablo.fernandez1 and @rob.schafer for the idea.

1 Like

That’s great - Thanks for letting us know @mualapat

@mualapat Can you please share which file and lines of code that needs to be commented out to make this work? Thanks!

@lyu38 as of the current version ( it’s line 3 of newrelic/admin/record_deploy.py.


Got it working now. Thanks! @rob.schafer

1 Like

Thanks for helping out @rob.schafer :smiley: