pmorissette / ffn

ffn - a financial function library for Python
pmorissette.github.io/ffn
MIT License
2.03k stars 300 forks source link

Install error #73

Closed kite8 closed 3 years ago

kite8 commented 5 years ago

when I install ffn, there's a error:

(base) E:\Python\ffn>python -m pip install -e .
Obtaining file:///E:/Python/quantaxis/ffn
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "E:\Python\quantaxis\ffn\setup.py", line 16, in <module>
        re.MULTILINE
    AttributeError: 'NoneType' object has no attribute 'groups'

then I found this function has a problem:

In [8]: local_file('ffn/__init__.py').read()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-8-cb625aa46290> in <module>()
----> 1 local_file('ffn/__init__.py').read()

<ipython-input-2-b4939a16acc3> in local_file(filename)
      1 def local_file(filename):
      2     return codecs.open(
----> 3         os.path.join(os.path.dirname(__file__), filename), 'r', 'utf-8'
      4     )

NameError: name '__file__' is not defined

so I modify the function local_file

def local_file(filename):
    return open(
        os.path.join(os.path.dirname(__file__), filename), 'r', encoding='utf-8'
    )

then the installing is ok.

lefig commented 4 years ago

I just encountered the same problem after much frustration.

It would be great to have this fixed.