I have a python package that I need to install via `pip` as part of my project's requirements file, but I need to copy some files from my package to the projects installing this package. I'm thinking of doing it using the data\_files option in `setup()` like:

```
setup(
    name='my_pacakge',
    ...
    data_files=[
        ('example/folder1', ['something1/file1.ext', 'something1/file2.ext']),
        ('folder2', ['something2/file1.ext', 'something2/file2.ext']),
    ]
)

```

and I woud like these files to be copied into paths relative to the directory where `pip install my_package` was run from, ideally my project root, leaving a tree as follows

```
project_root
├── example
│   └── folder1
│       ├── file1.ext
│       └── file2.ext
└── folder2
    ├── file1.ext
    └── file2.ext

```

but for this I will need to know the absolute path of where pip install my\_package was run from. I've tried with `inspect.stack`, `inspect.currentframe`, `sys.get_frame`, `inspect.inspect.getouterframes(some_of_these_frames)` but this only gives me information about the current location of setup.py at installation time, which is directories like

```
/private/var/folders/gq/vpylvs0d51162jtyqhtgdc6m0000gn/T/pip-tNcbvb-build
/var/folders/gq/vpylvs0d51162jtyqhtgdc6m0000gn/T/pip-6a8MKS-build/setup.py

```

which is not useful at all for my purpose.

Now, I'm aware `setuptools`/`setup.py` should no be used like this but I really need to pack some files in the installable package and copy/move them to the project root at installation time.

Any suggestions on how to accomplish this?

Thanks! :)