Installing pyDARN
For most users, pyDARN can be installed simply by:
pip3 install pydarn
If already installed, pyDARN can be upgraded by:
pip3 install --upgrade pydarn
Installing in virtual environments is recommended, see below for details.
Prerequisites
pyDARN requires python 3.8 or later, see list below for library dependencies.
Note
Python 3.6 is commonly the default version included on many operating systems, you may need to install a newer version and specify the newer version when running python programs and installing libraries.
Depending on your operating system or distribution, the following package installers, development environments or data parsers are required:
| Ubuntu | OpenSuse | Fedora | OSX | Windows |
|---|---|---|---|---|
| libyaml-dev | python3-PyYAML | libyaml-devel | Xcode/pip | pip |
You can check your python version using
$ python --version or
$ python3 --version
Dependencies
On installation, pyDARN will download the following dependencies:
pyDARN will also install any dependencies of the above libraries.
Cartopy
Updates to the Cartopy library mean that new versions can be installed as dependencies easily, unlike earlier versions which required an installation process. If you have any issues with the installation, you can try to pre-install Cartopy before pyDARN:
To install cartopy please follow the official installation instructions.
Virtual Environments
It is recommended to install pyDARN in a virtual environment if you have multiple python versions on your computer, or do not want to affect the main systems python libraries.
pip Virtual Environment
Instructions can be found here virtual environment
Option 1:
$ python3 -m pip install --user venv(Install virtual environment package)$ python3 -m venv <environment name>(Make your virtual environment)$ source <environment name>/bin/activate(Activate the virtual environment)$ pip3 install pydarn(Install pyDARN)
Note
In python versions <3.10, venv was virtualenv.
Anaconda Virtual Environment
Instructions can be found here conda environment and installing anaconda
$ conda create -n yourenvname python=3.8 anaconda$ conda activate yourenvname$ pip install pydarn
Note
The pyDARN developers have limited experience using Anaconda so may be unable to troubleshoot issues.
Adding the environment to PyCharm
To set the project interpreter to the anaconda environment:
- File -> Settings -> Project Folder -> Project Interpreter
- Click the project Interpreter drop down list and click on show all.
- If you don't see the environment you wish to use click the plus sign on the right side bar named "Add"
- Select "Conda Environment" on the left side menu.
- Click "Existing Environment" and give the interpreter field the path to your environment's python.exe and apply.
Installing for Development or Testing
pyDARN's default github branch is develop for quicker and easer development.
git clone https://github.com/SuperDARN/pydarn.git
To install a specific branch to develop or test:
cd pydarn
git checkout branch_name
pip3 install .
You can alternatively install a specific branch using the following installation, this is most useful for testing new branches:
pip3 install git+https://github.com/superdarn/pydarn@branch_name
Please read pyDARN Workflow documentation for more information on developing for pyDARN.
Troubleshooting
Some known issues with solutions are:
pip3 installation with Ubuntu 20.4/python 3.8.4
Issue: pip3 install --user git+https://github.com/superdarn/pydarn@develop not working
Solution:
- check git is installed
apt install git(for ubuntu) - Check pip version
pip --version- with newer distros of Linux/Virtual machinespipmay point to python3 and you will not need pip3. - Alternative virtual environment steps for getting python 3.8 working
$ sudo apt-get update
$ sudo apt-get install python3-virtualenv python3-pip
$ cd ~/
$ mkdir venvs
$ virtualenv -p python3.8 ~/venvs/py38
$ echo "source $HOME/venvs/py38/bin/activate" >> ~/.bashrc
Then open a new terminal and you should see (pyy38) in the prompt.
More details on issue #37
aacgmv2 won't install
Issue: unable to execute 'gcc': No such file or directory error: command 'gcc' failed with exit status 1
Solution:
- Ensure
gccis installed if not install it - Ensure you install
python3-dev(Ubuntu) orpython3-develfor RPM OS Linux operating systems.
General Plotting Errors
Solution:
- check matplotlib version, if lower than 3.7.0, then upgrade matplotlib to an equal or higher version.
pip install -U matplotlib
Note
If you find any problems/solutions, please make a github issue so the community can help you or add it to the documentation!