Unable to import libaugeas! on OSX El Capitan

I'm on OS X El Capitan

I tried: './letsencrypt-auto certonly --webroot -w /Users/myuserid/blah/letsencrypt/ds.com -d davidsilvasmith.com -d www.davidsilvasmith.com'

First I got this error

grep: /etc/os-release: No such file or directory
WARNING: Mac OS X support is very experimental at present...
if you would like to work on improving it, please ensure you have backups
and then run this script again with the --debug flag!

Running with --debug now I get this error:

An unexpected error occurred:
ImportError: Unable to import libaugeas!
Please see the logfile 'letsencrypt.log' for more details.

I tried brew install augeas

Warning: augeas-1.2.0 already installed, it's just not linked

I tried brew link augeas

Error: Could not symlink lib/pkgconfig/augeas.pc
/usr/local/lib/pkgconfig is not writable.

I tried sudo brew link augeas

Error: Cowardly refusing to sudo brew link

I tried brew doctor

a bunch of issues

I tried brew update

Error: undefined method close!' for nil:NilClass Please report this bug: https://github.com/Homebrew/homebrew/wiki/troubleshooting /usr/local/Library/Homebrew/extend/pathname.rb:129:in ensure in atomic_write'
/usr/local/Library/Homebrew/extend/pathname.rb:129:in atomic_write' /usr/local/Library/Homebrew/cmd/untap.rb:42:in unlink_tap_formula'
/usr/local/Library/Homebrew/cmd/update.rb:24:in update' /usr/local/Library/brew.rb:134:in '

I tried 'sudo chown myuserid /usr/local/lib/pkgconfig'

I tried 'brew link augeas'

Linking /usr/local/Cellar/augeas/1.2.0... 15 symlinks created

I tried again './letsencrypt-auto certonly --webroot -w /Users/myuserid/blah/letsencrypt/ds.com -d davidsilvasmith.com -d www.davidsilvasmith.com --debug'

ImportError: Unable to import libaugeas!

I’m running Mac OS 10.6.8 Snow Leopard.

I had to add Homebrew’s lib path to the environment variable DYLD_LIBRARY_PATH but as the letsencrypt-auto shell script does its own sudo, i had to add it to the inner main python script command instead (with the git clone as working directory):

sudo DYLD_LIBRARY_PATH=`brew --prefix`/lib ~/.local/share/letsencrypt/bin/letsencrypt --help

I am running Yosemite. And I am stuck at the same ImportError: Unable to import libaugeas!

I get the following response trying your suggested code (without the --help):

No installers are available on your OS yet; try running "letsencrypt-auto certonly" to get a cert you can install manually

Any suggestions?

I am running El Capitan, works fine without issues. I had xcode installed which is required.

Follow these instructions: Tutorial for OS X local certificates and Shared Hosting

You could use pip install letsencrypt as that also works.

I ended up using a Linux CentOS 6 machine to create my cert.

Bummer I didn’t get it working on my primary machine.

@StopSpazzing I am on El Capitan with XCode Installed. I also tried the pip install letsencrypt and then couldn’t figure out how to run it after it installed. To be fair I didn’t spend more than 2-5 minutes trying.

I found possible cause in letsencrypt/letsencrypt-auto-source/pieces/bootstrappers/mac.sh

Look at his code:

  # Workaround for _dlopen not finding augeas on OS X
  if [ "$pkgman" = "port" ] && ! [ -e "/usr/local/lib/libaugeas.dylib" ] && [ -e "/opt/local/lib/libaugeas.dylib" ]; then
    echo "Applying augeas workaround"
    $SUDO ln -s /opt/local/lib/libaugeas.dylib /usr/local/lib
  fi

It’s wrong bause this creates bogus symlink /usr/local/lib -> /opt/local/lib/libaugeas.dylib if /usr/local/lib directory does not exist.

  1. Script should make sure /usr/local/lib directory exists (if not create it)
  2. $SUDO ln -s /opt/local/lib/libaugeas.dylib /usr/local/lib/

GitHub issue submited