# Compilation error (relocation R\_X86\_64\_PC32 against symbol \`\_Py\_NoneStruct' can not be used)

**URL:** <https://root-forum.cern.ch/t/compilation-error-relocation-r-x86-64-pc32-against-symbol-py-nonestruct-can-not-be-used/53132>\
**Category:** Newbie\
**Created:** [January 16, 2023, 10:07pm UTC](https://root-forum.cern.ch/t/compilation-error-relocation-r-x86-64-pc32-against-symbol-py-nonestruct-can-not-be-used/53132 "2023-01-16T22:07:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ampudia](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ampudia/32/32149_2.png) [@ampudia](https://root-forum.cern.ch/u/ampudia)\
**Post date:** [January 16, 2023, 10:07pm UTC](https://root-forum.cern.ch/t/compilation-error-relocation-r-x86-64-pc32-against-symbol-py-nonestruct-can-not-be-used/53132/1 "2023-01-16T22:07:59Z")

</div>

\_Hi!  
I am trying to install root-6.26.10 on Ubuntu 22.04 and, when I run the “make” command, at 97%, I keep getting this error:  
[97%] Linking CXX shared library …/…/lib/libROOTTPython.so  
/usr/bin/ld: /usr/local/lib/libpython3.10.a(pythonrun.o): warning: relocation against `_Py_UnhandledKeyboardInterrupt' in read-only section `.text’  
/usr/bin/ld: /usr/local/lib/libpython3.10.a(bytearrayobject.o): relocation R\_X86\_64\_PC32 against symbol `\_Py\_NoneStruct’ can not be used when making a shared object; recompile with -fPIC  
/usr/bin/ld: final link failed: bad value  
collect2: error: ld returned 1 exit status  
make[2]: \*\*\* [bindings/tpython/CMakeFiles/ROOTTPython.dir/build.make:151: lib/libROOTTPython.so] Error 1  
make[1]: \*\*\* [CMakeFiles/Makefile2:34934: bindings/tpython/CMakeFiles/ROOTTPython.dir/all] Error 2  
make: \*\*\* [Makefile:156: all] Error 2

Does anyone know what is causing the error or how can I fix it?

Thank you very much!

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 16, 2023, 10:53pm UTC](https://root-forum.cern.ch/t/compilation-error-relocation-r-x86-64-pc32-against-symbol-py-nonestruct-can-not-be-used/53132/2 "2023-01-16T22:53:17Z")

</div>

It seems you only have the static “`libpython3.10.a`” library, but you actually need the shared (“`libpython3.10.so`”) one. Talk to the one who installed it in the “`/usr/local/lib`” directory.

---

<div class="post-metadata">

**Author:** ![ampudia](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ampudia/32/32149_2.png) [@ampudia](https://root-forum.cern.ch/u/ampudia)\
**Post date:** [January 17, 2023, 10:47pm UTC](https://root-forum.cern.ch/t/compilation-error-relocation-r-x86-64-pc32-against-symbol-py-nonestruct-can-not-be-used/53132/4 "2023-01-17T22:47:21Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [January 18, 2023, 11:29am UTC](https://root-forum.cern.ch/t/compilation-error-relocation-r-x86-64-pc32-against-symbol-py-nonestruct-can-not-be-used/53132/5 "2023-01-18T11:29:38Z")

</div>

Also, please take a look at the [Install](https://root.cern/install/) instructions on the ROOT website. Building ROOT from sources is something we discourage for regular users unless justified otherwise.

That said, the preferred method of installing ROOT is via a [binary package](https://root.cern/install/#linux-package-managers) for your distribution or via a [Conda](https://root.cern/install/#conda) package. That should save you some headaches (unless you have a very strong reason to build ROOT from sources…).

Cheers,  
J.
