# Workaround for installing missing python module?

**URL:** <https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304>\
**Category:** Help\
**Created:** [March 22, 2025, 7:20am UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304 "2025-03-22T07:20:15Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![csam](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/csam/32/5361_2.png) [@csam](https://gramps.discourse.group/u/csam)\
**Post date:** [March 22, 2025, 7:20am UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/1 "2025-03-22T07:20:15Z")

</div>

Continuing the discussion from [Please help add 5.2 Highlights to the wiki](https://gramps.discourse.group/t/please-help-add-5-2-highlights-to-the-wiki/4921/2):

> [@Please help add 5.2 Highlights to the wiki](https://gramps.discourse.group/t/please-help-add-5-2-highlights-to-the-wiki/4921/2):
>
> Mac does NOT install PIP (but I wish it did).

I’m running Gramps 5.2 on MacOS as a bundled install (.dmg)  
The add-on GrampsWebSync uses keyring if installed.  
Unfortunately keyring is missing.  
Is there any way to install this module - a dirty hack is ok for me.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [March 22, 2025, 11:21am UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/2 "2025-03-22T11:21:53Z")

</div>

Does this 2015 osx keychain thread seem pertinent:

> <https://stackoverflow.com/questions/29740808/how-to-fetch-proxy-password-from-osx-keychain-in-python>

---

<div class="post-metadata">

**Author:** ![csam](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/csam/32/5361_2.png) [@csam](https://gramps.discourse.group/u/csam)\
**Post date:** [March 22, 2025, 11:54am UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/3 "2025-03-22T11:54:54Z")

</div>

> [@emyoulation](#):
>
> Does this 2015 osx keychain thread seem pertinent:

No, this just describes how to use keychain in python.  
The GampsWebSync already has the code implemented, however the problem is the statement “import keyring” which returns an error because the module doesn’t exists in the installation. If ‘pip’ had been part of the Gramps package for MacOS, but pip is also missing.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [March 22, 2025, 11:58am UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/4 "2025-03-22T11:58:21Z")

</div>

What about the part saying he installed keyring with `sudo easy_install keyring`

---

<div class="post-metadata">

**Author:** ![csam](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/csam/32/5361_2.png) [@csam](https://gramps.discourse.group/u/csam)\
**Post date:** [March 22, 2025, 12:03pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/5 "2025-03-22T12:03:47Z")

</div>

> [@emyoulation](#):
>
> sudo easy\_install keyring

easy\_install was the predecessor of pip. I don’t think it has been in python for years.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [March 22, 2025, 12:27pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/6 "2025-03-22T12:27:02Z")

</div>

> prompted perplexity with : “As an expert in installing software for MacOS and the keyring software for use in python ; a 2015 posting suggested `sudo easy_install keyring` … what is a modern method”

[Answer from Perplexity](https://www.perplexity.ai/search/4b0700ee-4447-4de2-96aa-78282a38538d?utm_source=copy_output):

The modern method for installing the Python `keyring` library on macOS is to use `pip`, the Python package manager. Here’s how you can do it:

1. **Open Terminal** on your macOS.
2. Use one of the following commands to install the library:

- For Python 3:

bash

```python
pip3 install keyring

```

- Alternatively, you can specify Python explicitly:

bash

```python
python3 -m pip install keyring

```

This approach ensures compatibility with Python 3 and avoids potential issues with ambiguous `pip` commands that might default to Python 2[1](https://blog.finxter.com/how-to-install-keyring-in-python/)[4](https://pypi.org/project/keyring/)[10](https://www.allscient.com/post/securely-storing-credentials-in-python-with-keyring).

## Additional Notes:

- If you encounter issues with installation, ensure that `pip` is up-to-date by running:

bash

```python
python3 -m pip install --upgrade pip

```

- Avoid using `easy_install`, as it is outdated and no longer recommended[9](https://pypi.org/project/keyring/3.0.1/).
- If you use virtual environments, activate the environment before running the installation command to keep dependencies isolated.

By following these steps, you will have the latest version of `keyring` installed and ready for use in your Python projects.

### Citations:

1. [How to Install keyring in Python? – Be on the Right Side of Change](https://blog.finxter.com/how-to-install-keyring-in-python/)
2. [Install py-keyring on macOS with MacPorts](https://ports.macports.org/port/py-keyring/)
3. [macos - How to fetch proxy password from osx keychain in python? - Stack Overflow](https://stackoverflow.com/questions/29740808/how-to-fetch-proxy-password-from-osx-keychain-in-python)
4. [keyring · PyPI](https://pypi.org/project/keyring/)
5. [Install py312-keyring on macOS with MacPorts](https://ports.macports.org/port/py312-keyring/)
6. [python - Keyring apparently not installed correctly with pip macos - Stack Overflow](https://stackoverflow.com/questions/69007042/keyring-apparently-not-installed-correctly-with-pip-macos)
7. [Migrating to the new installer may cause keyring failures for existing keyring items on MacOS · Issue #7243 · python-poetry/poetry · GitHub](https://github.com/python-poetry/poetry/issues/7243)
8. [python-keyring-lib/README.rst at master · philipn/python-keyring-lib · GitHub](https://github.com/philipn/python-keyring-lib/blob/master/README.rst)
9. [keyring · PyPI](https://pypi.org/project/keyring/3.0.1/)
10. [https://www.allscient.com/post/securely-storing-credentials-in-python-with-keyring](https://www.allscient.com/post/securely-storing-credentials-in-python-with-keyring)

> So I asked: “What if pip is not installed on the mac”

[Answer from Perplexity](https://www.perplexity.ai/search/4b0700ee-4447-4de2-96aa-78282a38538d?utm_source=copy_output):

If pip is not installed on your Mac, you have several options to install it:

1. Use the ensurepip module (for Python 3.4+):  
Open Terminal and run:

bash

```python
python3 -m ensurepip

```

This will install pip without requiring an internet connection[1](https://phoenixnap.com/kb/install-pip-mac).  
2. Install via Homebrew:  
If you have Homebrew installed, you can install Python (which includes pip) by running:

bash

```python
brew install python

```

After installation, run:

bash

```python
brew unlink python && brew link python

```

to ensure pip is in your path[1](https://phoenixnap.com/kb/install-pip-mac)[5](https://macpaw.com/how-to/install-pip-mac).  
3. Use the get-pip.py script:  
Download the script and run it:

bash

```python
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py

```

This method works for Python 3 or later[1](https://phoenixnap.com/kb/install-pip-mac).

After installation, verify pip is installed by running:

bash

```python
pip --version

```

or

bash

```python
pip3 --version

```

If you encounter any issues, ensure you’re using the correct Python version and that your system PATH is properly configured[3](https://www.bodhost.com/kb/how-to-set-up-pip-on-your-macos-system/)[5](https://macpaw.com/how-to/install-pip-mac).

### Citations:

1. [How to Install Pip on Mac {3 Methods} | phoenixNAP KB](https://phoenixnap.com/kb/install-pip-mac)
2. [5. Using Python on macOS — Python 3.14.0 documentation](https://docs.python.org/3/using/mac.html)
3. [How to Set Up PIP on Your MacOS System - bodHOST](https://www.bodhost.com/kb/how-to-set-up-pip-on-your-macos-system/)
4. [macos - Python package management in Mac OS X - Stack Overflow](https://stackoverflow.com/questions/21289974/python-package-management-in-mac-os-x)
5. [Mac pip install guide: how to install pip 2 different ways](https://macpaw.com/how-to/install-pip-mac)
6. [Best Way to Install Python · Mac Install Guide · 2025](https://mac.install.guide/python/)
7. [python - How do I install pip on macOS or OS X? - Stack Overflow](https://stackoverflow.com/questions/17271319/how-do-i-install-pip-on-macos-or-os-x)
8. [Installing Packages - Python Packaging User Guide](https://packaging.python.org/tutorials/installing-packages/)

---

<div class="post-metadata">

**Author:** ![lsc](https://avatars.discourse-cdn.com/v4/letter/l/58956e/32.png) [@lsc](https://gramps.discourse.group/u/lsc)\
**Post date:** [March 22, 2025, 1:17pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/7 "2025-03-22T13:17:33Z")

</div>

Do not use the HomeBrew Python with Gramps. It is missing some locale entry points that Gramps relies on. [6.0.0 rc1 on Mac - #3 by lsc](https://gramps.discourse.group/t/6-0-0-rc1-on-mac/7185/3)

You can get ahead of the missing packages by installing for the local user with pip (pip3 install --user \<package\>). Cleaner than dumping into the system installation and does not require sudo.

Cheers

---

<div class="post-metadata">

**Author:** ![GaryGriffin](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/garygriffin/32/6525_2.png) [@GaryGriffin](https://gramps.discourse.group/u/GaryGriffin)\
**Post date:** [March 22, 2025, 5:02pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/8 "2025-03-22T17:02:22Z")

</div>

What I do when the Gramps dmg does not have a package I need is the following hack:

install using pip into the OS and then copy the installed folder (and all new dependencies) into EITHER the gramplet folder or `Gramps.app/Contents/Resources/lib/python3.11`

This should allow the new gramplet to work.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [March 22, 2025, 6:06pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/9 "2025-03-22T18:06:15Z")

</div>

This is excellent information.

I was expecting that the [“troubleshooting gramps paths and environmental variables” hack](https://gramps.discourse.group/t/troubleshooting-gramps-paths-and-environmental-variables/5692) would have a path for the Python.  
But the closest path was:  
`ROOT_DIR : /app/lib/python3.11/site-packages/gramps`

@Nick-Hall could the `Requires` dialogs in [Addon Manager](https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Navigation#Using_the_Addon_Manager) list the 2 potential target paths for manual installs?

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [March 22, 2025, 6:23pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/10 "2025-03-22T18:23:32Z")

</div>

> [@emyoulation](#):
>
> @Nick-Hall could the `Requires` dialogs in [Addon Manager](https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Navigation#Using_the_Addon_Manager) list the 2 potential target paths for manual installs?

Anyone who is attempting to manually install python modules should know how to print the contents of `sys.path`.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [March 22, 2025, 6:53pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/11 "2025-03-22T18:53:56Z")

</div>

> [@Nick-Hall](#):
>
> Anyone who is attempting to manually install python modules should know how to print the contents of `sys.path`.

Everyone has to start learning somewhere.

And cannot sys.path return different data if they have minimal Python bundled with Python application (like Gramps) and a more expansive developer environment installed?

---

<div class="post-metadata">

**Author:** ![csam](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/csam/32/5361_2.png) [@csam](https://gramps.discourse.group/u/csam)\
**Post date:** [March 22, 2025, 7:13pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/12 "2025-03-22T19:13:06Z")

</div>

Thanks @GaryGriffin

Here’s what I did:

> brew install python@3.11  
> pip3.11 --verbose install keyring  
> GRAMPS\_SITE=/Applications/Gramps.app/Contents/Resources/lib/python3.11/site-packages/.  
> cp -R /usr/local/lib/python3.11/site-packages/jaraco\* $GRAMPS\_SITE  
> cp -R /usr/local/lib/python3.11/site-packages/keyring\* $GRAMPS\_SITE  
> cp -R /usr/local/lib/python3.11/site-packages/setuptools $GRAMPS\_SITE  
> cp -R /usr/local/lib/python3.11/site-packages/zipp\* $GRAMPS\_SITE  
> cp -R /usr/local/lib/python3.11/site-packages/backport\* $GRAMPS\_SITE  
> cp -R /usr/local/lib/python3.11/site-packages/more\_itertool\*\* $GRAMPS\_SITE

The pip3.11 command with --verbose needed in order to see what was installed.

Running GrampsWebSync now picks up the last used password automatically.

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [March 22, 2025, 7:16pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/13 "2025-03-22T19:16:48Z")

</div>

> [@emyoulation](#):
>
> And cannot sys.path return different data if they have minimal Python bundled with Python application (like Gramps) and a more expansive developer environment installed?

Yes, it will depend on your environment. Gramps doesn’t actually have to know the location to check if the requirement is satisfied.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [March 22, 2025, 7:33pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/14 "2025-03-22T19:33:58Z")

</div>

> [@Nick-Hall](#):
>
> Yes, it will depend on your environment. Gramps doesn’t actually have to know the location to check if the requirement is satisfied.

One problem I have experienced was that pip was installing GEDCOMX\_v1 lib (needed by the FamilySearch addons by @jmichault ) to the general Python evironment and the Requires was evidently checking the Gramps bundled Python. It did not recognize the prerequisite was there until installing with the bundled pip in the Gramps path while in that location.

So knowing the preferred path for the bundled Python lib folder seems to be important. And checking ‘sys.path’ with a script from the [command line](https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Command_Line) was giving the other path.

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [March 22, 2025, 8:28pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/15 "2025-03-22T20:28:23Z")

</div>

> [@emyoulation](#):
>
> And checking ‘sys.path’ with a script from the [command line](https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Command_Line) was giving the other path.

I would check `sys.path`. It gives 7 different paths for me, but I can’t think of a better alternative.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [March 22, 2025, 10:31pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/16 "2025-03-22T22:31:46Z")

</div>

> [@Nick-Hall](#):
>
> I would check `sys.path`. It gives 7 different paths for me, but I can’t think of a better alternative.

Perhaps it could it use `ROOT_DIR` and go up 2 levels? Is the end of the `ROOT_DIR` always `python3.11/site-packages/gramps` in all 3 platforms?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [April 21, 2025, 10:32pm UTC](https://gramps.discourse.group/t/workaround-for-installing-missing-python-module/7304/17 "2025-04-21T22:32:05Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
