Ok, I am re-reading your page:
When I read before, I couldn't find any "config" directory under my new python dir, but I think that you mean this directory?
[root@apache1 config-3.6m-x86_64-linux-gnu]# pwd
/apps/python-3.6.3/lib/python3.6/config-3.6m-x86_64-linux-gnu
[root@apache1 config-3.6m-x86_64-linux-gnu]# ls -al
total 15644
drwxr-xr-x 2 root root 4096 Nov 8 00:43 .
drwxr-xr-x 35 root root 4096 Nov 8 00:33 ..
-rw-r--r-- 1 root root 3302 Nov 8 00:33 config.c
-rwxr-xr-x 1 root root 7122 Nov 8 00:33 install-sh
-rw-r--r-- 1 root root 15874060 Nov 8 00:33 libpython3.6m.a
lrwxrwxrwx 1 root root 19 Nov 8 00:43 libpython3.so -> ../../libpython3.so
-rw-r--r-- 1 root root 67977 Nov 8 00:33 Makefile
-rwxr-xr-x 1 root root 7521 Nov 8 00:33 makesetup
-rwxr-xr-x 1 root root 2050 Nov 8 00:33 python-config.py
-rw-r--r-- 1 root root 10096 Nov 8 00:33 python.o
-rw-r--r-- 1 root root 15322 Nov 8 00:33 Setup
-rw-r--r-- 1 root root 327 Nov 8 00:33 Setup.config
-rw-r--r-- 1 root root 41 Nov 8 00:33 Setup.local
So I re-built Python 3.6.3, with the "--enable-shared" and I think I figured out where the 'config' dir you were referring to (above).
As you can see, I have now added a softlink for libpython3.so but now I am still getting an error, even if run just "python3.6 -V":
[root@apache1 config-3.6m-x86_64-linux-gnu]# python3.6 -V
python3.6: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
So I added another softlink to "libpython3.6m.so.1.0":
[root@apache1 config-3.6m-x86_64-linux-gnu]# ls -al
total 15644
drwxr-xr-x 2 root root 4096 Nov 8 00:56 .
drwxr-xr-x 35 root root 4096 Nov 8 00:33 ..
-rw-r--r-- 1 root root 3302 Nov 8 00:33 config.c
-rwxr-xr-x 1 root root 7122 Nov 8 00:33 install-sh
-rw-r--r-- 1 root root 15874060 Nov 8 00:33 libpython3.6m.a
lrwxrwxrwx 1 root root 26 Nov 8 00:56 libpython3.6m.so.1.0 -> ../../libpython3.6m.so.1.0
lrwxrwxrwx 1 root root 19 Nov 8 00:43 libpython3.so -> ../../libpython3.so
-rw-r--r-- 1 root root 67977 Nov 8 00:33 Makefile
-rwxr-xr-x 1 root root 7521 Nov 8 00:33 makesetup
-rwxr-xr-x 1 root root 2050 Nov 8 00:33 python-config.py
-rw-r--r-- 1 root root 10096 Nov 8 00:33 python.o
-rw-r--r-- 1 root root 15322 Nov 8 00:33 Setup
-rw-r--r-- 1 root root 327 Nov 8 00:33 Setup.config
-rw-r--r-- 1 root root 41 Nov 8 00:33 Setup.local
[root@apache1 config-3.6m-x86_64-linux-gnu]#
but I still get an error:
[root@apache1 config-3.6m-x86_64-linux-gnu]# python3.6 -V
python3.6: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
Then I added "export LD_LIBRARY_PATH=/apps/python-3.6.3/lib/" and then "python3.6 -V" worked.
Is THAT (adding the LD_LIBRARY_PATH necessary)?
Or, putting that another way, what did I do wrong that caused adding the LD_LIBRARY_PATH to be a necessity?