# Cannot access file in python "unsafe use of relative rpath"

**URL:** <https://root-forum.cern.ch/t/cannot-access-file-in-python-unsafe-use-of-relative-rpath/26565>\
**Category:** ROOT\
**Created:** [October 13, 2017, 7:32am UTC](https://root-forum.cern.ch/t/cannot-access-file-in-python-unsafe-use-of-relative-rpath/26565 "2017-10-13T07:32:32Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![ksmith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksmith/32/12567_2.png) [@ksmith](https://root-forum.cern.ch/u/ksmith)\
**Post date:** [October 17, 2017, 1:44pm UTC](https://root-forum.cern.ch/t/cannot-access-file-in-python-unsafe-use-of-relative-rpath/26565/17 "2017-10-17T13:44:27Z")

</div>

> [@mwilkins](#):
>
> ```python
> $ python2
> Python 2.7.14 (default, Sep 25 2017, 09:54:19) 
> [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from ROOT import TFile
> Fatal Python error: PyThreadState_Get: no current thread
> Abort trap: 6
> 
> ```

> [@mwilkins](#):
>
> Okay so I found on this thread that python quitting is due to conflicting python versions. The same thread recommends sticking with the system build though.

This is the same error message I get from the system python, therefore I assume you build ROOT against the system python and not homebrew. You can check which python you built against with this command:

```bash
grep "/python$" root-build-dir/CMakeCache.txt

```

I am avoiding using the system python and building ROOT against the version provided from macports (the same can be done with homebrew). macports provides a simple method to set there version as the default in the path and I suspect something like that exists for homebrew as well. After that the build of ROOT will use the non system python by default. Alternatively, you can force CMake to use a specific version of python with the following:

```bash
cmake root-source -DPYTHON_EXECUTABLE=/usr/local/bin/python

```

> [@How to properly install PyROOT for Python 3?](https://root-forum.cern.ch/t/how-to-properly-install-pyroot-for-python-3/26367/3):
>
> You can use -DPYTHON\_EXECUTABLE=/path/to/desired/python without aliasing anything.

---

_[View the full topic](https://root-forum.cern.ch/t/cannot-access-file-in-python-unsafe-use-of-relative-rpath/26565)._
