# PyROOT import error (PyInit\_libPyROOT)

**URL:** <https://root-forum.cern.ch/t/pyroot-import-error-pyinit-libpyroot/16263>\
**Category:** ROOT\
**Created:** [June 20, 2013, 4:06pm UTC](https://root-forum.cern.ch/t/pyroot-import-error-pyinit-libpyroot/16263 "2013-06-20T16:06:11Z")\
**Posts on this page:** 1\
**Showing post:** 16

<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:** [January 9, 2018, 2:53pm UTC](https://root-forum.cern.ch/t/pyroot-import-error-pyinit-libpyroot/16263/16 "2018-01-09T14:53:15Z")

</div>

The `python3` flag does not work the way you think it would. You probably have python 2 as the default python?

> [@How to properly install PyROOT for Python 3?](https://root-forum.cern.ch/t/how-to-properly-install-pyroot-for-python-3/26367):
>
> I am attempting to install the Python3 bindings for ROOT, but always seem to end up with Python2 bindings. I have used the CMake flags -Dpython=ON and -Dpython3=ON. I have both python2 and python3 installed and the python command defaults to the python 2 version. From a posting by @Graipher I have a suspicion that it has to do with what the default python version is (he has the opposite issue). Do I need to change where the default points before configuring to get the correct version? Also…

> [@PyROOT cannot open file: "Error in \<TNetXNGFile::Open\>: \[FATAL\] Auth failed"](https://root-forum.cern.ch/t/pyroot-cannot-open-file-error-in-tnetxngfile-open-fatal-auth-failed/26593/21):
>
> Thanks for doing the leg work on this. In addition to assisting those who want to use non-default python versions this is also needed for python3 installations when python2 is the default. I was going to update the other topic, but it is locked. So the best I can do is link it here and hope that it is seen by others with this issue: You can always create an alias that points to the python2 version: alias python=python2

> [@Questions about ROOT6 packaging](https://root-forum.cern.ch/t/questions-about-root6-packaging/27219/3):
>
> Hi @vp1981, I intend to work on packaging ROOT for some Linux distributions in the next year, and on making it easier for others to package it in other distros too. The idea is to provide scripts for configuring and compiling ROOT and to make ROOT follow FHS more closely, as you propose above. As for the question you have, let me answer it in parts. About Python I saw in your configuration that you have python=OFF and python3=ON, please invert that to python=ON and python3=OFF, regardless of …

[JIRA 9033](https://sft.its.cern.ch/jira/browse/ROOT-9033?jql=text%20~%20%22python3%22)

---

_[View the full topic](https://root-forum.cern.ch/t/pyroot-import-error-pyinit-libpyroot/16263)._
