GenericMappingTools / pygmt

A Python interface for the Generic Mapping Tools.
https://www.pygmt.org
BSD 3-Clause "New" or "Revised" License
754 stars 218 forks source link

Run PyGMT on Windows #439

Closed Ruaa93 closed 4 years ago

Ruaa93 commented 4 years ago

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

output of conda list
PASTE OUTPUT OF CONDA LIST HERE
welcome[bot] commented 4 years ago

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.

seisman commented 4 years ago

@Ruaa93 When you follow the install instructions and run pip install pygmt, you're installing pygmt v0.1.0. However, to run pygmt on Windows, currently you have to install the master branch instead.

Please try:

pip install https://github.com/GenericMappingTools/pygmt/archive/master.zip

and follow the workaround for Windows.

We're working on the new release pygmt v0.1.1, it should be available in next few days.

seisman commented 4 years ago

@Ruaa93 We just released PyGMT v0.1.1, which is expected to work smoothly on Windows. Please follow the latest install instructions.

Ruaa93 commented 4 years ago

it works, thanks a lot.

Ruaa93 commented 4 years ago

@seisman I have a question, I'm trying to create a gravity map (for example Bouguer anomaly) using PYGMT, is there any similar codes or toturials to show how can gravity or magnatic maps can be created?