Setting up Yambo: Difference between revisions

From The Yambo Project
Jump to navigation Jump to search
(Created page with details about the installation of yambo)
 
(Reorganization of sections)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Setting up Yambo, yambopy (and eventually QE or abinit)  ==
To able to follow the tutorials you need a running version of the yambo, yambopy (and QE or abinit codes).
To be able to follow the school you need a running version of the yambo, yambopy (and QE or abinit codes).
 
There are several different ways to prepare a working environment.
There are several different ways to prepare a working environment.


=== Virtual Machine(s) ===
== Virtual Machine(s) ==
The easiest way is to access to a virtual machine which contains both (i) yambo/QE and (ii) the tutorials.
The easiest way is to access to a virtual machine which contains both (i) yambo/QE and (ii) the tutorials.


Line 18: Line 16:
-->
-->


=== User installation  ===
== User installation  ==
You can also setup the yambo code on your on laptop / desktop using different methods.
You can also setup the yambo code on your on laptop / desktop using different methods.


Line 26: Line 24:
* Install yambo on your laptop/desktop/cluster [https://github.com/nicspalla/my-repo via Spack].
* Install yambo on your laptop/desktop/cluster [https://github.com/nicspalla/my-repo via Spack].
* Install using  Anaconda.
* Install using  Anaconda.
== Setting up an environment ==
=== python env ===
You can create a python environment and activate it:
python -m venv MYPATH/yamboenv/
source MYPATH/yamboenv/bin/activate
=== conda env ===
As an alternative we suggest to consider conda environments.
To setup Anaconda, please start from installing [https://www.anaconda.com/products/distribution#Downloads Anaconda] or [https://docs.conda.io/en/latest/miniconda.html Miniconda].
Then to create a conda environment and activate it:
conda create --name yambo-env -c conda-forge
conda activate yambo-env


=== Yambo User Installation with Anaconda ===
=== Yambo User Installation with Anaconda ===
It is possible to install Yambo (up to v5.0.4) and Quantum-ESPRESSO via conda-forge (a conda channel/repository):
It is possible to install Yambo (up to v5.0.4) and Quantum-ESPRESSO via conda-forge (a conda channel/repository):
To setup Anaconda, please start from installing [https://www.anaconda.com/products/distribution#Downloads Anaconda] or [https://docs.conda.io/en/latest/miniconda.html Miniconda].


Then we suggest to create a conda environment and activate it:
conda create --name yambopy -c conda-forge
conda activate yambopy
Then you can install the prerequisites and the two codes:
Then you can install the prerequisites and the two codes:
  conda install numpy scipy netcdf4 matplotlib pyyaml lxml pandas
  conda install numpy scipy netcdf4 matplotlib pyyaml lxml pandas
Line 39: Line 48:
  conda install qe
  conda install qe


==Setting up Yambopy==
== Setting up Yambopy inside an enviroment ==
 
===Quick installation===
 
A quick way to start using Yambopy is described here.
 
* Make sure that you are using Python 3 and that you have the following python packages: <code>numpy</code>, <code>scipy</code>, <code>matplotlib</code>, <code>netCDF4</code>, <code>lxml</code>, <code>pyyaml</code>. Optionally, you may want to have abipy [[https://abinit.github.io/abipy/index.html]] installed for band structure interpolations.
 
* Go to a directory of your choice and clone yambopy from the git repository
 
git clone https://github.com/yambo-code/yambopy.git
 
If you don't want to use git, you may download a tarball from the git repository instead.
 
* Enter into the yambopy folder and install
 
cd yambopy
sudo python setup.py install
 
If you don't have administrative privileges (for example on a computing cluster), type instead
 
cd yambopy
python setup.py install --user
 
===Installing dependencies with Anaconda===
We suggest installing yambopy using Anaconda [[https://www.anaconda.com/products/distribution]] to manage the various python packages.
 
In this case, you can follow these steps.
 
First, install the required dependencies:
conda install numpy scipy netcdf4 lxml pyyaml
 
Then we create a conda environment based on python 3.6 (this is to ensure compatibility with abipy if we want to install it later on):
conda create --name NAME_ENV python=3.6
Here choose <code>NAME_ENV</code> as you want, e.g. <code>yenv</code>.
 
Now, we install abipy and its dependency pymatgen using <code>pip</code>. Here make sure that you are using the <code>pip</code> version provided by Anaconda and not your system version.
 
pip install pymatgen
pip install abipy
 
Finally, we are ready to install yambopy:
 
git clone https://github.com/yambo-code/yambopy.git
 
(or download and extract tarball) and follow the steps outlined in the quick installation section.
 
Now enter into the yambopy folder and install
 
cd yambopy
sudo python setup.py install
 
If you don't have administrative privileges (for example on a computing cluster), type instead
 
cd yambopy
python setup.py install --user
 
===Frequent issues===
When running the installation you may get a <code>SyntaxError</code> related to utf-8 encoding or it may complain that module <code>setuptools</code> is not installed even though it is. In this case, it means that the <code>sudo</code> command is not preserving the correct <code>PATH</code> for your python executable.


Solve the problem by running the installation step as
You can simply type in a suitable python environment.


  sudo /your/path/to/python setup.py install
  pip install yambopy
or
sudo env PATH=$PATH python setup.py install


This applies only to the installation step and not to subsequent yambopy use.
For more information, go to the [[First steps in Yambopy| Yambopy setup page]].

Latest revision as of 12:01, 3 October 2024

To able to follow the tutorials you need a running version of the yambo, yambopy (and QE or abinit codes). There are several different ways to prepare a working environment.

Virtual Machine(s)

The easiest way is to access to a virtual machine which contains both (i) yambo/QE and (ii) the tutorials.

You can do it in one of two ways:

  • Virtual machine via ICTP cloud If the schools you are attending provided an ICTP virtual machine this is the preferred option. It works through internet connection inside a browser.
  • Install the yambo virtual machine on your laptop / desktop. This requires Oracle virtual box. Pre-download of the Virtual machine. No internet connection needed.

User installation

You can also setup the yambo code on your on laptop / desktop using different methods.

As far as the Yambo source is concerned you can:

Setting up an environment

python env

You can create a python environment and activate it:

python -m venv MYPATH/yamboenv/
source MYPATH/yamboenv/bin/activate

conda env

As an alternative we suggest to consider conda environments. To setup Anaconda, please start from installing Anaconda or Miniconda. Then to create a conda environment and activate it:

conda create --name yambo-env -c conda-forge
conda activate yambo-env

Yambo User Installation with Anaconda

It is possible to install Yambo (up to v5.0.4) and Quantum-ESPRESSO via conda-forge (a conda channel/repository):

Then you can install the prerequisites and the two codes:

conda install numpy scipy netcdf4 matplotlib pyyaml lxml pandas
conda install yambo 
conda install qe

Setting up Yambopy inside an enviroment

You can simply type in a suitable python environment.

pip install yambopy

For more information, go to the Yambopy setup page.