Rootpy installation

Dear Root Wizards,

I have a problem with rootpy installation on Ubuntu.
My problem is probably related to the fact, that I can not do it in my home directory (this is an account in network or something like that). I want to do it in my local directory: /usr/local

  1. I installed python with --enabled-shared
  2. I installed root using: ./configure --prefix=/usr/local --with-python-incdir=/usr/local/include/python2.4 --with-python-libdir=/usr/local/lib/

I think that python and root works correctly. These are basic tests (to check if I have correct files):

  1. $/usr/local/include$ ls
    python2.7 root
  2. $/usr/local/lib$ ls
    libpython2.7.so libpython2.7.so.1.0 pkgconfig python2.7 python3.5 root setuptools-28.8.0.zip
  3. when I go to: /usr/local/lib/root$ I have file: ROOT.py

However, when I try to install rootpy: sudo -H pip install rootpy
InsecurePlatformWarning
Using cached rootpy-0.8.3.tar.gz
Complete output from command python setup.py egg_info:
ROOT cannot be imported. Is ROOT installed with PyROOT enabled?

Do you know what to do?

Hi,

does the PYTHONPATH envar have /usr/local/lib/root in its list?

Cheers,
Wim

I am not very fluent in linux, so I checked few options:

  1. echo $PYTHONPATH → gives nothing
  2. import sys

sys.path
[‘’, ‘/usr/local/lib/python27.zip’, ‘/usr/local/lib/python2.7’, ‘/usr/local/lib/python2.7/plat-linux2’, ‘/usr/local/lib/python2.7/lib-tk’, ‘/usr/local/lib/python2.7/lib-old’, ‘/usr/local/lib/python2.7/lib-dynload’, ‘/home/usr201/mnt/blatacz/.local/lib/python2.7/site-packages’, ‘/usr/local/lib/python2.7/site-packages’, ‘/usr/local/lib/python2.7/site-packages/setuptools-28.8.0-py2.7.egg’]

  1. print(os.environ.get(‘PYTHONPATH’, ‘’)) → also gives nothing

It means, that I have to add a path to root to pythonpath?

Hi,

yes; depending on whether your shell is from the bash or csh family, set either:export PYTHONPATH=/usr/local/lib/root:$PYTHONPATHor:setenv PYTHONPATH /usr/local/lib/root:$PYTHONPATH
Cheers,
Wim

Thank you.
Indeed, it is part of a problem. However, it still does not work.

I also tried Location independent installation. I added paths to root/bin ($PATH) and root/lib ($LD_LIBRARY_PATH). Also $PYTHONPATH is /usr/local/home/blatacz/root/lib.
but still when I try to do:
sudo pip install rootpy
I receive:
Exception:
Traceback (most recent call last):
File “/usr/local/lib/python2.7/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/usr/local/lib/python2.7/site-packages/pip/commands/install.py”, line 324, in run
requirement_set.prepare_files(finder)
File “/usr/local/lib/python2.7/site-packages/pip/req/req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “/usr/local/lib/python2.7/site-packages/pip/req/req_set.py”, line 554, in _prepare_file
require_hashes
File “/usr/local/lib/python2.7/site-packages/pip/req/req_install.py”, line 281, in populate_link
self.link = self._wheel_cache.cached_wheel(self.link, self.name)
File “/usr/local/lib/python2.7/site-packages/pip/wheel.py”, line 68, in cached_wheel
self._cache_dir, link, self._format_control, package_name)
File “/usr/local/lib/python2.7/site-packages/pip/wheel.py”, line 129, in cached_wheel
wheel_names = os.listdir(root)
OSError: [Errno 13] Permission denied: ‘/home/usr201/mnt/blatacz/.cache/pip/wheels/e4/25/a3/2145bdbe8f3a75ca000ec279147127025daf28760256f9122c’

I do not know why, it wants a permission from my “other” account. It should be simply installed in my local directory.
Do you know if I should use some other pip options? I tries -i, but it does not work.
I tries to install rootpy from scratches, but I have the same message which tells that root was not configured with python eneabled.

Do you think that installing new Linux and starting everything from beginning may help?

Thank you.
Indeed, it is part of a problem. However, it still does not work.

I also tried Location independent installation. I added paths to root/bin ($PATH) and root/lib ($LD_LIBRARY_PATH). Also $PYTHONPATH is /usr/local/home/blatacz/root/lib.
but still when I try to do:
sudo pip install rootpy
I receive:
Exception:
Traceback (most recent call last):
File “/usr/local/lib/python2.7/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/usr/local/lib/python2.7/site-packages/pip/commands/install.py”, line 324, in run
requirement_set.prepare_files(finder)
File “/usr/local/lib/python2.7/site-packages/pip/req/req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “/usr/local/lib/python2.7/site-packages/pip/req/req_set.py”, line 554, in _prepare_file
require_hashes
File “/usr/local/lib/python2.7/site-packages/pip/req/req_install.py”, line 281, in populate_link
self.link = self._wheel_cache.cached_wheel(self.link, self.name)
File “/usr/local/lib/python2.7/site-packages/pip/wheel.py”, line 68, in cached_wheel
self._cache_dir, link, self._format_control, package_name)
File “/usr/local/lib/python2.7/site-packages/pip/wheel.py”, line 129, in cached_wheel
wheel_names = os.listdir(root)
OSError: [Errno 13] Permission denied: ‘/home/usr201/mnt/blatacz/.cache/pip/wheels/e4/25/a3/2145bdbe8f3a75ca000ec279147127025daf28760256f9122c’

I do not know why, it wants a permission from my “other” account. It should be simply installed in my local directory.
Do you know if I should use some other pip options? I tries -i, but it does not work.
I tries to install rootpy from scratches, but I have the same message which tells that root was not configured with python eneabled.

Do you think that installing new Linux and starting everything from beginning may help?

probably b/c you copied over some pip configuration files from the “other” account. Of course, at this point you have apparently done a lot of things of which I can only guess and hence am unlikely to provide any reasonable advice.

For example, not you say ROOT is installed under /usr/local/home/blatacz/root, but your previous configure command shown used /usr/local as prefix. Nothing sensible I can say with such conflicting information.

Not unless you also read some introductory material on how to use your shell and how to install packages with pip. But I’d choose to zap your local pip directory ($HOME/.pip) first, see whether that gets rid of old configuration. Also, check your environment with the ‘env’ command and see whether there is old stuff pointing to the “other” account left over somehow.

Cheers,
Wim

Thank you!

In the end, there was a problem with permissions.