FAQ
I'm working my way through my first non-tutorial Django project. I
plan to deploy it (at least initially) on Heroku. I'm at the point
where I have my basic structure laid out and am proceeding to model
definition. Heroku's default database is PostgreSQL, which I'm
comfortable with, and seems to be installed properly there. The
locally built psycopg2 module (2.5.1) is missing libssl, however:

(venv)topten% python manage.py shell
ImportError: dlopen(/Users/skip/heroku/topten/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so,
2): Library not loaded: libssl.1.0.0.dylib
   Referenced from:
/Users/skip/heroku/topten/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so
   Reason: image not found

Looking on my Mac running Snow Leopard (10.6.8), I only see 0.9.x
versions of libssl in /usr/lib. I have no libssl in my MacPorts
directory (/opt/local/lib).

Where did whatever built psycopg2 (pip?) get the idea that I had
libssl 1.0? More importantly, how can I get past this bump in the
road?

Thanks,

Skip Montanaro

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANc-5UwY67Yh%3DoJJO%3D2TjOighTOK8xiviQz4oei3NS4oEVdK%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Doug Snyder at Oct 27, 2013 at 2:46 pm
    I don't have a very specific answer for your question. I just started doing
    my django dev on OSX coming from Ubuntu
    My understanding is that Home Brew is a better solution than Mac Ports, I
    have heard some people being very critical of Mac Ports which I think was
    once the best solution for python environments on OSX but I think has been
    mostly replaced by Home Brew. Switching over may solve your problem
    automatically and may make life easier down the road too. But maybe someone
    else will have a more knowledgable, specific answer to your specific
    problem.
    Another solution that doesn't require and headaches is that Mavericks, the
    new OSX release may still be free for download. They announced it was free
    but the way they worded it made it sound like it may have only been free
    for the day it came out. Not sure if that's a road you want to go down or
    not.
    Good Luck,
    Doug


    On Sun, Oct 27, 2013 at 10:20 AM, Skip Montanaro
    wrote:
    I'm working my way through my first non-tutorial Django project. I
    plan to deploy it (at least initially) on Heroku. I'm at the point
    where I have my basic structure laid out and am proceeding to model
    definition. Heroku's default database is PostgreSQL, which I'm
    comfortable with, and seems to be installed properly there. The
    locally built psycopg2 module (2.5.1) is missing libssl, however:

    (venv)topten% python manage.py shell
    ImportError:
    dlopen(/Users/skip/heroku/topten/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so,
    2): Library not loaded: libssl.1.0.0.dylib
    Referenced from:

    /Users/skip/heroku/topten/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so
    Reason: image not found

    Looking on my Mac running Snow Leopard (10.6.8), I only see 0.9.x
    versions of libssl in /usr/lib. I have no libssl in my MacPorts
    directory (/opt/local/lib).

    Where did whatever built psycopg2 (pip?) get the idea that I had
    libssl 1.0? More importantly, how can I get past this bump in the
    road?

    Thanks,

    Skip Montanaro

    --
    You received this message because you are subscribed to the Google Groups
    "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/django-users/CANc-5UwY67Yh%3DoJJO%3D2TjOighTOK8xiviQz4oei3NS4oEVdK%3Dw%40mail.gmail.com
    .
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAo39dYUP87S4uJuHA0gd13EaPReMo7mGHZ3jtWwemFRSFFBpQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Skip Montanaro at Oct 27, 2013 at 9:12 pm
    Thanks for the response. I only mentioned MacPorts to demonstrate that when psycopg2 was built, pip couldn't have found libssl 1.x there. I routinely build my own Python instances. The venv version of Python is a 2.7.5+ version built from hg.

    Skip

    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/505b99cf-f371-46f9-b12b-ea4fcc71445a%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Tom Lockhart at Oct 28, 2013 at 1:39 pm

    On 2013-10-27, at 7:46 AM, Doug Snyder wrote:

    I don't have a very specific answer for your question. I just started doing my django dev on OSX coming from Ubuntu
    My understanding is that Home Brew is a better solution than Mac Ports, I have heard some people being very critical of Mac Ports which I think was once the best solution for python environments on OSX but I think has been mostly replaced by Home Brew. Switching over may solve your problem automatically and may make life easier down the road too. But maybe someone else will have a more knowledgable, specific answer to your specific problem.
    I can't address any benefits of switching. But I have been using MacPorts for some time and have had no problems.

    Not sure who "some people" are wrt MacPorts but I haven't noticed complaints or problems (or in fact, any discussion of MacPorts vs Homebrew) in the context of Django or Postgres on the mailing list. I'm pretty sure both do this job just fine.

    hth

                          - Tom


    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6EE04A48-58D9-41EF-B312-C83B0B0E5BB7%40gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Adam Portier at Oct 28, 2013 at 7:35 pm
    Good afternoon,

    I just had this exact same problem and it took me a while to find the
    solution.

    On OSx there is a separate library path variable for .dylib library files.
    I added the following to my .bashrc (or.bash_env or however you set up your
    shell environment).

    export
    DYLD_LIBRARY_PATH="/usr/local/Cellar/openssl/1.0.1e/lib/:$DYLD_LIBRARY_PATH"

    The folder "/usr/local/Cellar/openssl/1.0.1e/lib/" contains
    the libssl.1.0.0.dylib file that Python is trying to load. You will need to
    find where your copy is installed (find / -name libssl.1.0.0.dylib) and
    adjust your environment variable setting accordingly. After that I was able
    to run my Django server with no problems.
    On Sunday, October 27, 2013 10:20:40 AM UTC-4, Skip Montanaro wrote:

    I'm working my way through my first non-tutorial Django project. I
    plan to deploy it (at least initially) on Heroku. I'm at the point
    where I have my basic structure laid out and am proceeding to model
    definition. Heroku's default database is PostgreSQL, which I'm
    comfortable with, and seems to be installed properly there. The
    locally built psycopg2 module (2.5.1) is missing libssl, however:

    (venv)topten% python manage.py shell
    ImportError:
    dlopen(/Users/skip/heroku/topten/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so,

    2): Library not loaded: libssl.1.0.0.dylib
    Referenced from:
    /Users/skip/heroku/topten/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so

    Reason: image not found

    Looking on my Mac running Snow Leopard (10.6.8), I only see 0.9.x
    versions of libssl in /usr/lib. I have no libssl in my MacPorts
    directory (/opt/local/lib).

    Where did whatever built psycopg2 (pip?) get the idea that I had
    libssl 1.0? More importantly, how can I get past this bump in the
    road?

    Thanks,

    Skip Montanaro
    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ad18ed90-ae0c-4e80-b942-0410ffc0c144%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Skip Montanaro at Oct 28, 2013 at 7:54 pm

    I just had this exact same problem and it took me a while to find the
    solution.

    On OSx there is a separate library path variable for .dylib library files. I
    added the following to my .bashrc (or.bash_env or however you set up your
    shell environment).

    export
    DYLD_LIBRARY_PATH="/usr/local/Cellar/openssl/1.0.1e/lib/:$DYLD_LIBRARY_PATH"
    Thanks for the suggestion. Found libssl in the PostgreSQL installation:

    % find / -name libssl.1.0.0.dylib 2>/dev/null
    /Library/PostgreSQL/9.2/lib/libssl.1.0.0.dylib
    /Library/PostgreSQL/9.2/pgAdmin3.app/Contents/Frameworks/libssl.1.0.0.dylib

    I guess that makes sense. I should be able to modify the activate
    script and deactivate function to set/reset DYLD_LIBRARY_PATH
    appropriately.

    Skip

    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANc-5Uwsjcw7B3sX2XkXCH%2BqCM1QX8x2BZT55U9RApK08PTgAg%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Matthias Fripp at Nov 10, 2013 at 3:22 pm
    I had the same problem. I am trying to make this work on a multi-user
    machine. My two options seem to be

    (1) Add this line to /etc/profile:

    export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib

    The disadvantage of this is that changing DYLD_LIBRARY_PATH doesn't seem to
    be a common technique on Macs, and I'm not sure whether this would run if
    python is being used by some specialized account (rather than a normal
    login account).

    (2) Create symbolic links in /usr/lib :

    sudo ln -s /Library/PostgreSQL/9.3/lib/libpq.5.dylib /usr/lib/libpq.5.dylib
    sudo ln -s /Library/PostgreSQL/9.3/lib/libssl.1.0.0.dylib
    /usr/lib/libssl.1.0.0.dylib
    sudo ln -s /Library/PostgreSQL/9.3/lib/libcrypto.1.0.0.dylib
    /usr/lib/libcrypto.1.0.0.dylib
    (It may also have been possible to place these symbolic links
    in /Library/Python/2.6/site-packages/psycopg2/ , next to _psycopg.so .)

    The disadvantage of using these symbolic links is that it will be harder to
    maintain when I switch to a new version of PostgreSQL. It was also tedious
    to find the list of missing dylibs by trial and error (in retrospect, I
    could have used otools
    -l /Library/Python/2.6/site-packages/psycopg2/_psycopg.so to get a full
    list of the libraries needed for psycopg2).

    I would still like to find the "normal" way to add the
    whole /Library/PostgreSQL/9.3/lib/ directory to the Mac's dynamic library
    search path, especially for a multi-user machine. Installing PostgreSQL via
    HomeBrew instead of EnterpriseDB might take care of this automatically?

    Matthias
    On Monday, October 28, 2013 9:54:05 AM UTC-10, Skip Montanaro wrote:

    I just had this exact same problem and it took me a while to find the
    solution.

    On OSx there is a separate library path variable for .dylib library files. I
    added the following to my .bashrc (or.bash_env or however you set up your
    shell environment).

    export
    DYLD_LIBRARY_PATH="/usr/local/Cellar/openssl/1.0.1e/lib/:$DYLD_LIBRARY_PATH"


    Thanks for the suggestion. Found libssl in the PostgreSQL installation:

    % find / -name libssl.1.0.0.dylib 2>/dev/null
    /Library/PostgreSQL/9.2/lib/libssl.1.0.0.dylib
    /Library/PostgreSQL/9.2/pgAdmin3.app/Contents/Frameworks/libssl.1.0.0.dylib


    I guess that makes sense. I should be able to modify the activate
    script and deactivate function to set/reset DYLD_LIBRARY_PATH
    appropriately.

    Skip
    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f914348c-462d-4c86-9fc1-0212e02e4c3b%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Tom Lockhart at Nov 10, 2013 at 4:08 pm

    On 2013-11-10, at 1:16 AM, Matthias Fripp wrote:

    I had the same problem. I am trying to make this work on a multi-user machine. My two options seem to be
    Neither seem good. I install most required packages which are not handled by pip using MacPorts (Homebrew works fine too afaik).

    This has several advantages, not the least of which is you can avoid the shenanigans happening for your options (1) and (2) below. But the biggest advantage for me is that it gives me control over the versioning for the packages I am using. If you want to revlock on a version of Postgres, you can do that. If you want to run a different version from what Apple is shipping, or want to get a security release right away, you can do that. And you don't have to go diving down into Apple's library structure to figure out where things live or what version you are actually running.

    hth

                               - Tom

    (1) Add this line to /etc/profile:

    export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib

    The disadvantage of this is that changing DYLD_LIBRARY_PATH doesn't seem to be a common technique on Macs, and I'm not sure whether this would run if python is being used by some specialized account (rather than a normal login account).

    (2) Create symbolic links in /usr/lib :

    sudo ln -s /Library/PostgreSQL/9.3/lib/libpq.5.dylib /usr/lib/libpq.5.dylib
    sudo ln -s /Library/PostgreSQL/9.3/lib/libssl.1.0.0.dylib /usr/lib/libssl.1.0.0.dylib
    sudo ln -s /Library/PostgreSQL/9.3/lib/libcrypto.1.0.0.dylib /usr/lib/libcrypto.1.0.0.dylib
    (It may also have been possible to place these symbolic links in /Library/Python/2.6/site-packages/psycopg2/ , next to _psycopg.so .)

    The disadvantage of using these symbolic links is that it will be harder to maintain when I switch to a new version of PostgreSQL. It was also tedious to find the list of missing dylibs by trial and error (in retrospect, I could have used otools -l /Library/Python/2.6/site-packages/psycopg2/_psycopg.so to get a full list of the libraries needed for psycopg2).

    I would still like to find the "normal" way to add the whole /Library/PostgreSQL/9.3/lib/ directory to the Mac's dynamic library search path, especially for a multi-user machine. Installing PostgreSQL via HomeBrew instead of EnterpriseDB might take care of this automatically?

    Matthias
    On Monday, October 28, 2013 9:54:05 AM UTC-10, Skip Montanaro wrote:
    I just had this exact same problem and it took me a while to find the
    solution.

    On OSx there is a separate library path variable for .dylib library files. I
    added the following to my .bashrc (or.bash_env or however you set up your
    shell environment).

    export
    DYLD_LIBRARY_PATH="/usr/local/Cellar/openssl/1.0.1e/lib/:$DYLD_LIBRARY_PATH"
    Thanks for the suggestion. Found libssl in the PostgreSQL installation:

    % find / -name libssl.1.0.0.dylib 2>/dev/null
    /Library/PostgreSQL/9.2/lib/libssl.1.0.0.dylib
    /Library/PostgreSQL/9.2/pgAdmin3.app/Contents/Frameworks/libssl.1.0.0.dylib

    I guess that makes sense. I should be able to modify the activate
    script and deactivate function to set/reset DYLD_LIBRARY_PATH
    appropriately.

    Skip

    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f914348c-462d-4c86-9fc1-0212e02e4c3b%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    Tom Lockhart
    tlockhart1976@gmail.com



    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/618B480B-60A0-4305-BAAC-3030359D0523%40gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdjango-users @
categoriesdjango, python
postedOct 27, '13 at 2:20p
activeNov 10, '13 at 4:08p
posts8
users5
websitedjangoproject.com

People

Translate

site design / logo © 2022 Grokbase