7

I am deploying a django server.

I've already installed python 3.5 without errors, but for some problems when I tried to compile mod_wsgi (so I could share the django app in an intranet environment with apache):

./configure --with-python=/usr/local/bin/python3.5

it told me that Failed to locate the Python library /usr/local/lib/libpython3.3m.so.

Searching for the solution on Google, I found this solution explaining that I needed to recompile python3 with --enable-shared flag.

so, I proceeded to remove python3 and python3.5 from /usr/local/bin and recompiled python3. Everything was fine, until I tried to check the python version with python3 --version and I got the following:

[rortega@Production Python-3.5.2]$ python3 --version
python3: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory

I can't find any solution to this.

Rafael Ortega
  • 173
  • 1
  • 1
  • 5

1 Answers1

5

Your system may not be looking in /usr/local/lib by default for shared libraries. When you compile things, set the environment variable:

export LD_RUN_PATH=/usr/local/lib

This is only needed when you compile things.

That or add /usr/local/lib to the directories searched by the system for shared libraries.

  • libpython3.5m.so.1.0 is indeed in /usr/local/lib. i recompiled python3 after executinr the command you gave, but i get the same error =( – Rafael Ortega Oct 27 '16 at 21:00
  • i just saw [this](https://github.com/GrahamDumpleton/mod_wsgi/issues/101) and you helped with that issue, what a coincidence from 1 year appart. ill follow what it says and ill let you know the results. – Rafael Ortega Oct 27 '16 at 21:34
  • GREAT!!! I been working on this issue all day, i followed this > ../configure --prefix=/usr/local --enable-shared --with-threads > LD_RUN_PATH=/usr/local/lib make > sudo make install and it did the thing. Thank you so much – Rafael Ortega Oct 27 '16 at 21:46