Skip to content

Run PyGMT on Windows #439

@Ruaa93

Description

@Ruaa93

Description of the problem
I just installed pygmt following the steps in https://www.pygmt.org/latest/install.html and the workaround for windows and setup the environment variable.

I want to know how to run the import pygmt to test it, cuz I run it multible times in spyder and jupyter and it gives me an error.

Full code that generated the error

import pygmt
pygmt.test()

Full error message

Python 3.6.10 (default, Mar  5 2020, 10:17:47) [MSC v.1900 64 bit (AMD64)]

Type "copyright", "credits" or "license" for more information.

 

IPython 7.14.0 -- An enhanced Interactive Python.

 

runfile('C:/Users/61410/.spyder-py3/temp.py', wdir='C:/Users/61410/.spyder-py3')

Traceback (most recent call last):

 

  File "C:\Users\61410\anaconda3\envs\pygmt\lib\site-packages\pygmt\clib\loading.py", line 42, in load_libgmt

    libgmt = ctypes.CDLL(libpath)

 

  File "C:\Users\61410\anaconda3\envs\pygmt\lib\ctypes\__init__.py", line 348, in __init__

    self._handle = _dlopen(self._name, mode)

 

OSError: [WinError 126] The specified module could not be found

 

 

During handling of the above exception, another exception occurred:

 

Traceback (most recent call last):

 

  File "C:\Users\61410\.spyder-py3\temp.py", line 8, in <module>

    import pygmt

 

  File "C:\Users\61410\anaconda3\envs\pygmt\lib\site-packages\pygmt\__init__.py", line 30, in <module>

    _begin()

 

  File "C:\Users\61410\anaconda3\envs\pygmt\lib\site-packages\pygmt\session_management.py", line 16, in begin

    with Session() as lib:

 

  File "C:\Users\61410\anaconda3\envs\pygmt\lib\site-packages\pygmt\clib\session.py", line 177, in __enter__

    self.create("pygmt-session")

 

  File "C:\Users\61410\anaconda3\envs\pygmt\lib\site-packages\pygmt\clib\session.py", line 328, in create

    restype=ctp.c_void_p,

 

  File "C:\Users\61410\anaconda3\envs\pygmt\lib\site-packages\pygmt\clib\session.py", line 276, in get_libgmt_func

    self._libgmt = load_libgmt()

 

  File "C:\Users\61410\anaconda3\envs\pygmt\lib\site-packages\pygmt\clib\loading.py", line 51, in load_libgmt

    raise GMTCLibNotFoundError(msg)

 

GMTCLibNotFoundError: Error loading the GMT shared library 'C:\Miniconda\envs\pygmt\Library\bin\gmt_w64.dll':

[WinError 126] The specified module could not be found

System information

  • Operating system:
  • Python installation (Anaconda, system, ETS):
  • Version of GMT:
  • Version of Python:
  • Version of this package:
  • If using conda, paste the output of conda list below:
output of conda list
PASTE OUTPUT OF CONDA LIST HERE

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions