gyanz/pydsstools

Install for 3.6?

Closed this issue · 12 comments

Is it possible to have this compatible with 3.6 as well? trying to use this with ESRI which only uses up to 3.6.

Thanks

gyanz commented

Is this python compiled with Microsoft C/C++ or MSC version 1900?

I also would greatly benefit from python 3.6 support. I haven't been able to get GDAL properly set up on 3.7 and primarily use:

Python 3.6.8 |Anaconda, Inc.| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

Similar to danhamill:

Python 3.6.7 (default, Jul 2 2019, 02:21:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

gyanz commented

I was able to build and import the extension module in Python 3.6. It will take me few days to test it thoroughly. In the meantime, please send me an email if you would like to try it out in your computer.

I sent you an e-mail (at your e-mail address listed on your account).
Thanks so much and I will try this out on my computer!

I may be doing something wrong on the install? I am getting this error when trying to import HecDss

import pydsstools
from pydsstools.heclib.dss import HecDss

AttributeError Traceback (most recent call last)
in
1 import pydsstools
----> 2 from pydsstools.heclib.dss import HecDss

D:\xxxx\xxxx\pydsstools\heclib\dss\HecDss.py in
10 import pandas as pd
11
---> 12 from ...core import Open as _Open
13 from ...core.grid import SpatialGridStruct
14 from ...core import getPathnameCatalog, deletePathname,PairedDataContainer,HecTime,DssPathName

D:\xxxx\xxxx\pydsstools\core_init_.py in
26
27 if arch_x64:
---> 28 from .._lib.x64.core_heclib import core_heclib
29
30 else:

D:\xxxx\xxxx\pydsstools_lib\x64\core_heclib.py in
10 elif major_minor == (3,6):
11 logging.debug('Importing core_heclib py3.6')
---> 12 from .py36 import core_heclib
13 else:
14 raise BaseException("core_heclib extension module not supported in this version of Python")

src\time_series.pyx in init core_heclib()

AttributeError: type object 'core_heclib.TimeSeriesStruct' has no attribute 'reduce_cython'

After install installing, here are the results from the example scripts

  • Example 1 = pass
  • Example 2 = pass
  • Example 3 = pass
  • Example 4 = pass
  • Example 5 = pass
  • Example 6 = pass
  • Example 7 = pass
  • Example 8 = pass
  • Example 9 = pass
  • Example 10 = fail
AttributeError                            Traceback (most recent call last)
<ipython-input-18-fd9613e46e0c> in <module>
     12     profile_out.update(type="PER-AVER",nodata=0,transform=dataset_in.transform) # required parameters
     13     profile_out.update(crs="UNDEFINED",units="ft",tzid="",tzoffset=0,datasource='') # optional parameters
---> 14     grid_out = np.random.rand(*grid_in.shape)*100
     15     fid.put_grid(pathname_out,grid_out,profile_out,flipud=1)
     16

AttributeError: 'NoneType' object has no attribute 'shape'
  • Example 11 = pass
  • Example 12 = pass
  • Example 13 = pass

@tgrout To install, I had to modify python_requires in the setup.py from master:

"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
"""

from __future__ import print_function
from setuptools import setup,find_packages
from codecs import open
from os import path
from setuptools.dist import Distribution
import sys

#install_dir = path.join(sys.prefix,'Lib','site-packages','pydsstools')
proj_dir = path.abspath(path.dirname(__file__))

if not sys.platform.startswith('win'):
    sys.exit('Sorry only Window is supported')

arch_x64 = False
if sys.maxsize > 2**32:
    arch_x64 = True

if not arch_x64:
    print('Currently, only the 64-bit Python is supported')

class BinaryDistribution(Distribution):
    def is_pure(self):
        return False

    def has_ext_modules(self):
        return True


with open(path.join(proj_dir,'README.md'), encoding='utf-8') as fid:
    long_description = fid.read()

setup(
    name='pydsstools',

    version = '0.7',

    description ='Python library to read-write HEC-DSS database file',

    long_description = long_description,

    url = '',

    author = 'Gyan Basyal',

    author_email = 'gyanBasyalz@gmail.com',


    license = 'MIT',

    classifiers = [
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Water resources engineers :: Developers',
        'Operating System :: Windows',
        'Programming Language :: Python :: 3.7',
     ],

    packages = find_packages(),


    package_data = {'':['*.txt','*.md',
                        '_lib/x86/*.pyd',
                        '_lib/x64/*.pyd',
                        'examples/*','LICENSE']},

    include_package_data = True,

    data_files=[],


    distclass = BinaryDistribution,

    install_requires = ['numpy', 'pandas', 'affine'],

    python_requires='>=3.6',

    )

Then I just had to copy over README.md to obtain long_description

I then installed it locally using:

python setup.py install

@danhamill Thanks!!! I figured I probably did something wrong with the install process. I will try this!

@gyanz Thank you for supporting python 3.6 👏 🥅 🕵 ! I just installed from master.

-D

Likewise, thank you very, very much!