How to install magnopy#
Requirement for magnopy installation are:
Python (>=3.9)
And several libraries:
# Package dependencies
numpy
wulfric>=0.6.3,==0.6.*
# Optional package dependencies [visual]
matplotlib
plotly
wulfric[visual]>=0.6.3,==0.6.*
Magnopy can be installed with pip or from source.
Do you have Python?#
Most likely Python is already installed on your machine (if not check these links: Python installation). One of the ways to check if you have python installed is to run the command in your terminal
python
If you see something like
Python 3.10.9 (main, Dec 15 2022, 18:25:35) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
then you have it.
In most cases python command launches python3, however if it launches python2, then
you may need to use python3 instead (and pip3 instead of pip).
Hint
Use exit() or press ctrl+D to close python console.
Hint
On linux and OSX systems one can create a virtual environment for the magnopy's installation with
(use your version of python instead of python3.13 if needed)
python3.13 -m venv .venv
And activate it with
source .venv/bin/activate
Installation with pip#
Magnopy is published and distributed from the Python package index. To install it use the command
(you may need to use pip3)
pip install magnopy
Hint
You can use the command
magnopy
to check whether the installation worked.
If there are any bugs with the installation, please drop a message to the developers through one of our User support channels and we would be happy to help.
Optionally, if you want magnopy to produce .png and .html files with graphics you can install Plotly and matplotlib manually or install them with magnopy as
pip install magnopy[visual]
Note
You may need to escape the [ and ] characters, because they are special
characters in most shells. For example, in bash you can use backslash to escape them
pip install magnopy\[visual\]
Or enclose full name in quotes
pip install "magnopy[visual]"
Hint
If you are using jupyter lab or notebook, then magnopy can be installed with
%pip install magnopy
or
%pip install "magnopy[visual]"
within it.
Installation from source#
Alternatively, source code of magnopy is publicly available under the GPL-3.0 license, therefore it is possible to install it from source.
Clone the project to your local computer (in other words: download the source code)
git clone git@github.com:magnopy/magnopy.git
Change the directory
cd magnopy
Install the requirements (you may need to use
pip3)pip install -r requirements.txt
To install magnopy, run (you may need to use
pip3)pip install .
Update#
If you want to update the package to the latest available version (0.3.0),
then use the command (you may need to use pip3)
pip install magnopy --upgrade