Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing fermitools and heasoft gives a warning #2

Open
ghost opened this issue Oct 14, 2022 · 4 comments
Open

Installing fermitools and heasoft gives a warning #2

ghost opened this issue Oct 14, 2022 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 14, 2022

Hello all, I found that when I install fermitools after installing HEAsoft, the following warning will appear,

You have LD_LIBRARY_PATH set. This might interfere with the correct functioning of conda and the Fermitools.
You have PYTHONPATH set. This might interfere with the correct functioning of conda and the Fermitools.

How can I install heasoft with fermitools without warning!!!

@zoghbi-a
Copy link
Collaborator

I have seen this in some circumstances. The best solution is to install heasoftpy and fermitools in a separate conda environment, and then activate the relevant environment as needed. For example, when installing heasoft(py), you do:

conda create -n heasoft python=3.8 "astropy>=4.0" "scipy>=1.6"
PYTHON=$CONDA_PREFIX/envs/heasoft/bin/python
# compile heasoft as ususal

And do the same with fermitools

conda create -n fermi python=3
conda install -n fermi -c conda-forge -c fermi fermitools clhep python=3

Then use conda activate to switch between the two environments.
Then, when you want to use the heasoft(py) tools:

conda activate heasoft
# use heasoft(py)
conda activate fermi
# use fermitools

I hope this helps.

@ghost
Copy link
Author

ghost commented Oct 14, 2022

I already know that the reason for these two warnings is because I configured these two environments when I configured the environment variables when installing HEAsoft,The first configured environment variables are as follows:

export HEADAS=/home/jisans/workspace/heasoft-6.30.1/x86_64-pc-linux-gnu-libc2.31
       . $HEADAS/headas-init.sh
echo $LD_LIBRARY_PATH
/home/jisans/workdir/heasoft-6.30.1/x86_64-pc-linux-gnu-libc2.31/lib
echo $PYTHONPATH
/home/jian/workdir/heasoft-6.30.1/x86_64-pc-linux-gnu-libc2.31/lib/python:/home/jian/workdir/heasoft-6.30.1/x86_64-pc-linux-gnu-libc2.31/lib

In this way, the environment variables are automatically initialized, and heasoft will automatically configure these two environment variables, and replace them with the following forms,

export HEADAS=/home/jisans/workspace/heasoft-6.30.1/x86_64-pc-linux-gnu-libc2.31
alias h=”. $HEADAS/headas-init.sh”

which only need to be initialized when using heasoft. I've been stuck with this problem!

@zoghbi-a
Copy link
Collaborator

It looks like fermitools expects empty LD_LIBRARY_PATH and PYTHONPATH to avoid potential conflict. That is why it prints the warning. I haven't seen any conflict myself, so I assume it is safe to ignore that warning. If you want to suppress it, you can unset those variables before activating the fermi environment. You do the following to add a script to do that automatically when the fermi environment is activated:

printf "unset LD_LIBRARY_PATH\n\
unset PYTHONPATH" > $CONDA_PREFIX/envs/fermi/etc/conda/activate.d/activate-a.sh

@ghost
Copy link
Author

ghost commented Oct 14, 2022

Your first command seems to be missing "

As long as I run Fermitools without initializing HEAsoft, the warning does not pop up, but if I want to initialize HEAsoft and use Fermitools the warning pops up!

operation result

(fermi3ML) jian@DESKTOP-10UCA6U:~$ printf "unset LD_LIBRARY_PATH\n\
> unset PYTHONPATH" > $CONDA_PREFIX/envs/fermi/etc/conda/activate.d/activate-a.sh
-bash: /home/jian/miniconda3/envs/fermi3ML/envs/fermi/etc/conda/activate.d/activate-a.sh: No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant