Hello! I’m new to both python and gmt. I installed pygmt 0.3.0 with anaconda following all instructions but when I try to import pygmt I get an error “no module named pygmt” … During the installation everything went fine, can anyone help me with this issue?.
Below is the run result in jupyter when the kernel has been changed from Python 3 to pygmt to test the program. Thank you.
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
~\anaconda3\envs\pygmt\lib\site-packages\numpy\core\__init__.py in <module>
21 try:
---> 22 from . import multiarray
23 except ImportError as exc:
~\anaconda3\envs\pygmt\lib\site-packages\numpy\core\multiarray.py in <module>
11
---> 12 from . import overrides
13 from . import _multiarray_umath
~\anaconda3\envs\pygmt\lib\site-packages\numpy\core\overrides.py in <module>
6
----> 7 from numpy.core._multiarray_umath import (
8 add_docstring, implement_array_function, _get_implementing_args)
ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-1-f58669fae37f> in <module>
----> 1 import pygmt
~\anaconda3\envs\pygmt\lib\site-packages\pygmt\__init__.py in <module>
13
14 # Import modules to make the high-level GMT Python API
---> 15 from pygmt import datasets
16 from pygmt.figure import Figure
17 from pygmt.modules import GMTDataArrayAccessor, config
~\anaconda3\envs\pygmt\lib\site-packages\pygmt\datasets\__init__.py in <module>
3 # Load sample data included with GMT (downloaded from the GMT cache server).
4
----> 5 from pygmt.datasets.earth_relief import load_earth_relief
6 from pygmt.datasets.tutorial import (
7 load_japan_quakes,
~\anaconda3\envs\pygmt\lib\site-packages\pygmt\datasets\earth_relief.py in <module>
5 The grids are available in various resolutions.
6 """
----> 7 import xarray as xr
8 from pygmt.exceptions import GMTInvalidInput
9 from pygmt.helpers import kwargs_to_strings
~\anaconda3\envs\pygmt\lib\site-packages\xarray\__init__.py in <module>
1 import pkg_resources
2
----> 3 from . import testing, tutorial, ufuncs
4 from .backends.api import (
5 load_dataarray,
~\anaconda3\envs\pygmt\lib\site-packages\xarray\testing.py in <module>
3 from typing import Hashable, Set, Union
4
----> 5 import numpy as np
6 import pandas as pd
7
~\anaconda3\envs\pygmt\lib\site-packages\numpy\__init__.py in <module>
143 from . import _distributor_init
144
--> 145 from . import core
146 from .core import *
147 from . import compat
~\anaconda3\envs\pygmt\lib\site-packages\numpy\core\__init__.py in <module>
46 """ % (sys.version_info[0], sys.version_info[1], sys.executable,
47 __version__, exc)
---> 48 raise ImportError(msg)
49 finally:
50 for envkey in env_added:
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "C:\Users\Lenovo\anaconda3\envs\pygmt\python.exe"
* The NumPy version is: "1.20.1"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.