I have a python package built from source code in /Document/pythonpackage
directory
/Document/pythonpackage/> python setup.py install
This creates a folder in site-packages
directory of python
import pythonpackage
print(pythonpackage.__file__)
>/anaconda3/lib/python3.7/site-packages/pythonpackage-x86_64.egg/pythonpackage/__init__.py
I am running a script on multiple environments so the only path I know I will have is pythonpackage.__file__
. However Document/pythonpackage has some data that is not in site-packages is there a way to automatically find the path to /Document/pythonpackage
given that you only have access to the module in python?