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. • ldd$(type -p python3) might give you some insights. – Valentin Bajrami Oct 27 '16 at 19:50
• is the libpython3.5m.so.1.0 marked as not found. the problem now is the it is in the correct location, but for some reason it doesn read it – Izuzvo Oct 27 '16 at 21:15

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

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