Python Forum

Full Version: Location of python library ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

How do I find the directory of libpython3.5.so file in my local machine,
am I suppose to have this file if I have downloaded Python3.5 ?
I'm using anaconda distribution by the way.
If you aere looking for a .so file you mist be running a some Unix (Linux or OSX) so:

find /usr/lib/ -name libpython3*.so -ls
14702689    0 lrwxrwxrwx   1 root     root           18 Nov 17 03:31 /usr/lib/x86_64-linux-gnu/libpython3.4m.so -> libpython3.4m.so.1
14818392    0 lrwxrwxrwx   1 root     root           41 Nov 17 03:31 /usr/lib/python3.4/config-3.4m-x86_64-linux-gnu/libpython3.4.so -> ../../x86_64-linux-gnu/libpython3.4m.so.1
14818390    0 lrwxrwxrwx   1 root     root           41 Nov 17 03:31 /usr/lib/python3.4/config-3.4m-x86_64-linux-gnu/libpython3.4m.so -> ../../x86_64-linux-gnu/libpython3.4m.so.1
(my Ubuntu 14.04 is still on 3.4)
Hi, Yes I'm using OSX.
that is what I did before but I got this:

find: /Users/kumakenkoji/Library/Saved Application State/com.adobe.flashplayer.installmanager.savedState: Permission denied
find: /Users/kumakenkoji/Library/Saved Application State/com.LaCie.LaCieSetup.savedState: Permission denied

And when I list my Library, python is not in there, I don't know if it's in a deeper directory though.
Would using anaconda distribution have any influence on this ?
Should I delete python and reinstall it ?
Well, you have to run it as administrator

sudo find /usr/lib/ -name "libpython3*.so" -print
I am not familiar with OSX but if the above do not find anything, change the search path to / instead of /usr/lib/. In order to prevent searching in the others disk partitions, add -xdev option before -name
...Thank you but
I got absolutely nothing (or nothing meaningful)after trying all sorts of combinations according to what you said.
Is it possible that I simply don't have that file even if I have Python installed?
Is anaconda distribution related to this problem?
Absolutely!
You have to point to you anaconda directory. When you install anaconda, it creates a whole new python environment that has nothing with your OS. Almost. Perhaps some additions to PATH env. var. to .bash_profile, some .hidden directories in your /home/user/.  It contain the python executable and all it needs. conda install install the packed inside this environment, under anaconda/ directory.
Try:
sudo find /path_to/anaconda/ -name "libpython3*.so" -print
Hi, thank you for your patience

This time I did find something similar but I don't have a libpython3.5.so file
I have a libpython3.5.dylib file.
Maybe they represent the same thing?
Don't know. Perhaps.
https://www.lifewire.com/dylib-file-2620908 :
"""
A file with the DYLIB file extension is a Mach-O (Mach Object) Dynamic Library file that application references during runtime in order to perform certain functions on an as-needed basis. The format has replaced the older A.OUT file format.

Mach-O is a file format that's used for various types of files including object code, shared libraries, core dumps, and executable files, so they might contain general data that multiple applications may reuse over time.
"""

There is a comprehensive answer to what is this extension here. I am a Linux user and have no idea at all Cool
Thank you again.
I'm trying to install a package(written in C++) to include Python extension in ./configure stage,
The user manual asks me to add a flag --with-python-libdir
whit this explanation:
"library directory should point to the directory containing libpythonx.y.so"

Do you have any idea about whether it's ok to just use path to my .dylib file instead ?
Hm!
What if the package looks for libpythonx.y.so but the file is dylib?
Really... can't tell. You may try to provide the path to the directory but what happens after that, I can only guess.

And this package is? Is there an instructions for OSX?

Pages: 1 2