Python problem with the initial source command

Hi,

I am just starting with the FCC analyses so bear with me !

At present I am following the FCCSW tutorial on lxplus. My default shell is bash. When I use the first command:

$ source /cvmfs/fcc.cern.ch/sw/latest/setup.sh

I get the following:

Setting up the latest Key4HEP software stack from CVMFS …
… Key4HEP release: key4hep-stack/2021-07-16
… Use the following command to reproduce the current environment:

source /cvmfs/sw.hsf.org/spackages2/key4hep-stack/2021-07-16/x86_64-centos7-gcc8.3.0-opt/wxwfgu65rjnk7s6frj25qsoq5miay4ft/setup.sh

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named ‘encodings’

Current thread 0x00007f749818b740 (most recent call first):
… done.

So I do not seem to have the correct python setup which I will require to follow the tutorial. Can some one help ?

Thanks
Roy

Hi Roy,

there can be a couple of possible reasons for this error, most of them because of some changes to the bash environment in your .bashrc. Could you try running in a clean shell, like this:

env -i bash --norc
source /cvmfs/fcc.cern.ch/sw/latest/setup.sh

and let me know if the error is still there?
Cheers,
Valentin

Hi Valentin,

In fact I just had a look in my .bashrc file and it had some old rivet related setup definitions including one for python. I removed them and it seems to work now. I was just about to reply …

I must admit that I rarely work on lxplus right now. Apologies for that.

In fact is there a way to get the FCCSW to work on a laptop ? Long term though … Do I need to install FCCSW locally using git ?

Thanks
Roy

But your bit of code works now.

Thanks
Roy

Hi Roy,

at the moment there is no binary distribution of FCCSW, but compiling things yourself, it’s certainly possible to install everything on a laptop. I can also provide a docker image with what is installed on cvmfs, if that helps.

Just to clarify: FCCSW is a collection of software packages that try to do full simulation, fast simulation, reconstruction, analysis, … Are you looking for everything or just the necessary things to run Delphes + FCCAnalysis? Even only the data files needed to run Geant4 take up some GiB, so if you don’t need to run that it’s maybe better to skip it. The advantage with CVMFS is that all of that is loaded only on demand.

If you are compiling things yourself, I’d recommend to try using spack (Using Spack to build Key4hep software — Key4hep documentation), which we use also to build the cvmfs installation.
It might compile ROOT from scratch, but it helps a lot as the software is spread out over many repositories (FCCSW only being a “bundle” without actual code) and spack will automatically install all dependencies.
Cheers,
Valentin

Hi Valentin,

I am just beginning at the FCCSW so I just need to run Delphes + FCCAnalysis (right now). So if you have a docker image available with what is installed on cvmfs then, yes, please send it across to me or tell me where to find it. I can then use that. If I can avoid compiling myself for now that would be ideal !

Cheers
Roy

Hello @rlemmon,

if I may comment here. For developments or playing with the code it’s totally fine to run locally, but if you start with more real analysis, and the need to use the common samples (stored on eos) it might be good not to get too much used to running locally.
It would be interesting for us to understand if you would be able to run just fine (also reading eos with some tricks we can provide) from your institute machines.
Happy to hear back from you if you would like to test this as well.

Cheers,
Clement

Hi Clement,

Ah I see. I had forgotten about the eos files you gave me access to. Perhaps it is best if I just continue to use lxplus right now for understanding the codes during August. Then I can reconsider things in September. I wondered why I should run on lxplus - I guess that is a good reason !

Cheers
Roy

Yes, this is a good reason. We are aware that we are still too much CERN centric wrt computing, and we hope to gradually move to a more distributed model.

Cheers,
Clement

Hi Roy,

yes, access to eos is easier among other things. For offline use it may still be interesting to have a docker image, so I prepared one anyway (I tried first with an ubuntu image but hit some build issues, so I switched to centos 7). So this is essentially a slimmed-down version of lxplus and the key4hep software currently distributed there. You can get and run it with

docker pull gitlab-registry.cern.ch/key4hep/k4-deploy:latest
docker run -it  gitlab-registry.cern.ch/key4hep/k4-deploy:latest bash

The latest fccanalyses and k4simdelphes packages are installed and set up, also the build tools necessary to recompile them. This is currently just a one-off image (so also the name and tags are liable to change), we’ll have to discuss the details, but in future I could make the image creation part of the automated builds.

For testing, I think it should be possible to read files on eos via xrootd, even outside the CERN network and without login (at least something like root root://eospublic.cern.ch//eos/experiment/fcc/ee/analyses/case-studies/flavour/Bc2TauNu/xgb_bdt_vtx.root worked for me).

Cheers, Valentin