Python - Can't import Pysal

613 Views Asked by At

I am using Pycharm in Windows 10, and I need to import Pysal to make some data transformations using DBF files with Pandas.

For that I have:

import pysal as ps
import pandas as pd
db = ps.open(dbfile) #Pysal to open DBF
d = {col: dbfile.by_col(col) for col in dbfile.header}

I have to install pysal packages but when I run "pip install pysal" I got the following error:

    raise OSError("could not find or load %s" % lib_name)
    OSError: could not find or load spatialindex_c-32.dll
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

How I can install pysal on my environment?

Thanks!

1

There are 1 best solutions below

3
On BEST ANSWER

The easiest thing you can do is to download it from Christoph Gohlke's site. You can install the whl file in your virtual environment by running

pip install [path to the whl file]

in your pycharm terminal.