# Root\_numpy installation issue

**URL:** <https://root-forum.cern.ch/t/root-numpy-installation-issue/22169>\
**Category:** ROOT\
**Created:** [November 8, 2016, 2:34pm UTC](https://root-forum.cern.ch/t/root-numpy-installation-issue/22169 "2016-11-08T14:34:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![doubleAron](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/doublearon/32/14106_2.png) [@doubleAron](https://root-forum.cern.ch/u/doubleAron)\
**Post date:** [November 8, 2016, 2:34pm UTC](https://root-forum.cern.ch/t/root-numpy-installation-issue/22169/1 "2016-11-08T14:34:34Z")

</div>

Hi,

So I am trying to install root\_numpy however I get the following error:

```auto
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0,
                 from /usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from root_numpy/src/_librootnumpy.cpp:283:
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \
  ^
root_numpy/src/_librootnumpy.cpp:308:26: fatal error: TTreeFormula.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
```

I know it says the API version is depreciated but I am not sure where to disable it as it recommends…  
My root version is 6.09  
python version 2.7.12  
gcc version is 5.4.0  
ubuntu 16.04.1 LTS

Any help would be greatly appreciated!!

Also, sorry if this is slightly off topic for the forum. Not sure where else to post though…

---

<div class="post-metadata">

**Author:** ![mato](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mato/32/12317_2.png) [@mato](https://root-forum.cern.ch/u/mato)\
**Post date:** [November 8, 2016, 5:51pm UTC](https://root-forum.cern.ch/t/root-numpy-installation-issue/22169/2 "2016-11-08T17:51:29Z")

</div>

Hi. You can probably report root\_numpy issues here: [github.com/rootpy/root\_numpy/issues](https://github.com/rootpy/root_numpy/issues)

In any case, we do build root\_numpy with ROOT master. We use these commands:

```auto
source <ROOT_PREFIX>/bin/thisroot.sh
env NOTVMA=1 python setup.py install --prefix <INSTALL_DIR>
```

Does the file $ROOTSYS/include/TTreeFormula.h actually exists?  
Can you provide the actual compilation command that fails (your output is very reduced).

---

<div class="post-metadata">

**Author:** ![doubleAron](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/doublearon/32/14106_2.png) [@doubleAron](https://root-forum.cern.ch/u/doubleAron)\
**Post date:** [November 9, 2016, 10:54am UTC](https://root-forum.cern.ch/t/root-numpy-installation-issue/22169/3 "2016-11-09T10:54:25Z")

</div>

[quote]

```auto
source <ROOT_PREFIX>/bin/thisroot.sh
env NOTVMA=1 python setup.py install --prefix <INSTALL_DIR>
```

Does the file $ROOTSYS/include/TTreeFormula.h actually exists?  
Can you provide the actual compilation command that fails (your output is very reduced).[/quote]

Hi,

I tried using “env NOTMVA=1 python [setup.py](http://setup.py) install” but got the following error(in full)

```auto
sudo env NOTVMA=1 python setup.py install

                 _
 _ _____  ___| |_ ___ _ _ _ _____ _ __ _ _
| ' __/ _ \ / _ \|__ | | '_ \| | | | '_ ` _ \| '_ \| | | |
| | | (_) | (_) | |_ | | | | |_| | | | | | | |_) | |_| |
|_| \ ___/ \___ / \ __|___ |_| |_|\ __,_|_| |_| |_| .__ / \__, | 4.6.0.dev0
                   | _____| |_| |___ /

running install
running bdist_egg
running egg_info
writing root_numpy.egg-info/PKG-INFO
writing top-level names to root_numpy.egg-info/top_level.txt
writing dependency_links to root_numpy.egg-info/dependency_links.txt
reading manifest file 'root_numpy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'AUTHORS'
writing manifest file 'root_numpy.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying root_numpy/config.json -> build/lib.linux-x86_64-2.7/root_numpy
running build_ext
building 'root_numpy._librootnumpy' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -Iroot_numpy/src -I/usr/include/python2.7 -c root_numpy/src/_librootnumpy.cpp -o build/temp.linux-x86_64-2.7/root_numpy/src/_librootnumpy.o -pthread -m64 -I/usr/include/root -Wno-unused-function -Wno-write-strings
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0,
                 from /usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from root_numpy/src/_librootnumpy.cpp:283:
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \
  ^
root_numpy/src/_librootnumpy.cpp:308:26: fatal error: TTreeFormula.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
```

I tried installing it and specifying the install folder, after adding the folder to PYTHONPATH, but got the following error

```auto
sudo env NOTVMA=1 python setup.py install --prefix ../rootNumpy

                 _
 _ _____  ___| |_ ___ _ _ _ _____ _ __ _ _
| ' __/ _ \ / _ \|__ | | '_ \| | | | '_ ` _ \| '_ \| | | |
| | | (_) | (_) | |_ | | | | |_| | | | | | | |_) | |_| |
|_| \ ___/ \___ / \ __|___ |_| |_|\ __,_|_| |_| |_| .__ / \__, | 4.6.0.dev0
                   | _____| |_| |___ /

running install
Checking .pth file support in ../rootNumpy/lib/python2.7/site-packages/
/usr/bin/python -E -c pass
TEST FAILED: ../rootNumpy/lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    ../rootNumpy/lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

    ''

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable. (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:

  https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations

Please make the appropriate changes for your system and try again.
```

If I echo my PYTHONPATH is is not empty as stated in the error… Not sure what to do!

Also, TTreeFormula does exist and is in the location you specified.  
Thanks!

---

<div class="post-metadata">

**Author:** ![wlav](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@wlav](https://root-forum.cern.ch/u/wlav)\
**Post date:** [November 14, 2016, 7:41pm UTC](https://root-forum.cern.ch/t/root-numpy-installation-issue/22169/4 "2016-11-14T19:41:36Z")

</div>

Hi,

[quote=“doubleAron”]Also, TTreeFormula does exist and is in the location you specified.[/quote]Probably that is wrong, as Pere asks for “$ROOTSYS/include/TTreeFormula.h” and the installation seems to think it should be under “/usr/include/root”.

(I’m not otherwise familiar with root\_numpy.)

Cheers,  
Wim
