{"id":407,"date":"2014-08-17T19:15:45","date_gmt":"2014-08-17T17:15:45","guid":{"rendered":"http:\/\/www.graverini.net\/elena\/?page_id=407"},"modified":"2015-12-01T11:47:19","modified_gmt":"2015-12-01T10:47:19","slug":"pyroot-lxplus","status":"publish","type":"page","link":"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/","title":{"rendered":"PyROOT and other Python modules on CERN lxplus"},"content":{"rendered":"<h5>Using PyROOT on lxplus<\/h5>\n<p>Install ROOT following the instructions on <a href=\"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/install-root\/\" title=\"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/install-root\/\">this page<\/a>. In order to use <strong>pyroot<\/strong> on LxPlus, there are further adjustments to do.<\/p>\n<p>First check the installation path of your python executable:<\/p>\n<p><code>which python<\/code><\/p>\n<p>Then export $PYTHONDIR as the path the folder above the bin and lib folder. For example:<\/p>\n<p><code>echo \"export PYTHONDIR=\/afs\/cern.ch\/sw\/lcg\/external\/Python\/2.7.3\/x86_64-slc6-gcc48-opt\" &gt;&gt; $HOME\/.bashrc<\/code><\/p>\n<p>Also update $PYTHONPATH and $LD_LIBRARY_PATH:<\/p>\n<p><code>echo \"export PYTHONPATH=$PYTHONPATH:$ROOTSYS\/lib\" &gt;&gt; $HOME\/.bashrc<\/code><br \/>\n<code>echo \"export LD_LIBRARY_PATH=$ROOTSYS\/lib:$PYTHONDIR\/lib:$LD_LIBRARY_PATH:\/opt\/rh\/python27\/root\/usr\/lib64\" &gt;&gt; $HOME\/.bashrc<\/code><\/p>\n<h5>Using other Python modules<\/h5>\n<p>To use external modules such as <strong>numpy<\/strong> or <strong>scipy<\/strong> it is almost always necessary to install them in your own afs workspace. The following example installs <a href=\"http:\/\/www.numpy.org\/\" title=\"http:\/\/www.numpy.org\/\">numpy<\/a> 1.8.2 (remember to check the latest version on <a href=\"http:\/\/sourceforge.net\/projects\/numpy\/files\/NumPy\/\" title=\"http:\/\/sourceforge.net\/projects\/numpy\/files\/NumPy\/\">SourceForge<\/a>!).<\/p>\n<p><code>mkdir my-numpy<\/code><br \/>\n<code>cd my-numpy<\/code><br \/>\n<code>wget http:\/\/switch.dl.sourceforge.net\/project\/numpy\/NumPy\/1.8.2\/numpy-1.8.2.tar.gz<\/code><br \/>\n<code>tar -xzf numpy-1.8.2.tar.gz<\/code><br \/>\n<code>mkdir INSTALL<\/code><br \/>\n<code>cd numpy-1.8.2<\/code><br \/>\n<code>python setup.py install --prefix=$HOME\/my-numpy\/INSTALL<\/code><\/p>\n<p>(Numpy needs to be compiled, as it includes some C++ code.)<\/p>\n<p>To use the compiled module, either do<\/p>\n<p><code>import sys<\/code><br \/>\n<code>sys.path.append('path\/to\/your\/home\/my-numpy\/INSTALL\/lib\/python2.7\/site-packages')<\/code><\/p>\n<p>in your python scripts, or copy the entire folder $HOME\/my-numpy\/INSTALL\/lib\/python2.7\/site-packages\/numpy (or, in other cases, the folder containing __init__.py) into your working directory, or add to $PYTHONPATH:<\/p>\n<p><code>export PYTHONPATH=path\/to\/your\/home\/my-numpy\/INSTALL\/lib\/python2.7\/site-packages:$PYTHONPATH<\/code><\/p>\n<p>Note that adding the install directory to <code>$PYTHONPATH<\/code> might be needed even before installing the package, depending on the package and the python distribution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using PyROOT on lxplus Install ROOT following the instructions on this page. In order to use pyroot on LxPlus, there are further adjustments to do. First check the installation path of your python executable: which python Then export $PYTHONDIR as&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":100,"menu_order":11,"comment_status":"closed","ping_status":"open","template":"","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PyROOT and other Python modules on CERN lxplus<\/title>\n<meta name=\"description\" content=\"How to use PyROOT and other Python modules on CERN lxplus machines.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PyROOT and other Python modules on CERN lxplus\" \/>\n<meta property=\"og:description\" content=\"How to use PyROOT and other Python modules on CERN lxplus machines.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/\" \/>\n<meta property=\"og:site_name\" content=\"Elena Graverini\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-01T10:47:19+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.graverini.net\/elena\/wp-content\/uploads\/2013\/12\/Penguins.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/\",\"url\":\"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/\",\"name\":\"PyROOT and other Python modules on CERN lxplus\",\"isPartOf\":{\"@id\":\"https:\/\/www.graverini.net\/elena\/#website\"},\"datePublished\":\"2014-08-17T17:15:45+00:00\",\"dateModified\":\"2015-12-01T10:47:19+00:00\",\"description\":\"How to use PyROOT and other Python modules on CERN lxplus machines.\",\"breadcrumb\":{\"@id\":\"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.graverini.net\/elena\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Computing\",\"item\":\"http:\/\/www.graverini.net\/elena\/computing\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Physics software\",\"item\":\"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"PyROOT and other Python modules on CERN lxplus\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.graverini.net\/elena\/#website\",\"url\":\"https:\/\/www.graverini.net\/elena\/\",\"name\":\"Elena Graverini\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.graverini.net\/elena\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PyROOT and other Python modules on CERN lxplus","description":"How to use PyROOT and other Python modules on CERN lxplus machines.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/","og_locale":"en_GB","og_type":"article","og_title":"PyROOT and other Python modules on CERN lxplus","og_description":"How to use PyROOT and other Python modules on CERN lxplus machines.","og_url":"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/","og_site_name":"Elena Graverini","article_modified_time":"2015-12-01T10:47:19+00:00","og_image":[{"width":1024,"height":768,"url":"http:\/\/www.graverini.net\/elena\/wp-content\/uploads\/2013\/12\/Penguins.jpg","type":"image\/jpeg"}],"twitter_misc":{"Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/","url":"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/","name":"PyROOT and other Python modules on CERN lxplus","isPartOf":{"@id":"https:\/\/www.graverini.net\/elena\/#website"},"datePublished":"2014-08-17T17:15:45+00:00","dateModified":"2015-12-01T10:47:19+00:00","description":"How to use PyROOT and other Python modules on CERN lxplus machines.","breadcrumb":{"@id":"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/pyroot-lxplus\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.graverini.net\/elena\/"},{"@type":"ListItem","position":2,"name":"Computing","item":"http:\/\/www.graverini.net\/elena\/computing\/"},{"@type":"ListItem","position":3,"name":"Physics software","item":"http:\/\/www.graverini.net\/elena\/computing\/physics-software\/"},{"@type":"ListItem","position":4,"name":"PyROOT and other Python modules on CERN lxplus"}]},{"@type":"WebSite","@id":"https:\/\/www.graverini.net\/elena\/#website","url":"https:\/\/www.graverini.net\/elena\/","name":"Elena Graverini","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.graverini.net\/elena\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"}]}},"_links":{"self":[{"href":"http:\/\/www.graverini.net\/elena\/wp-json\/wp\/v2\/pages\/407"}],"collection":[{"href":"http:\/\/www.graverini.net\/elena\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.graverini.net\/elena\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.graverini.net\/elena\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.graverini.net\/elena\/wp-json\/wp\/v2\/comments?post=407"}],"version-history":[{"count":12,"href":"http:\/\/www.graverini.net\/elena\/wp-json\/wp\/v2\/pages\/407\/revisions"}],"predecessor-version":[{"id":412,"href":"http:\/\/www.graverini.net\/elena\/wp-json\/wp\/v2\/pages\/407\/revisions\/412"}],"up":[{"embeddable":true,"href":"http:\/\/www.graverini.net\/elena\/wp-json\/wp\/v2\/pages\/100"}],"wp:attachment":[{"href":"http:\/\/www.graverini.net\/elena\/wp-json\/wp\/v2\/media?parent=407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}