Giter VIP home page Giter VIP logo

Comments (23)

briancappello avatar briancappello commented on May 10, 2024

If I remember correctly "make build" in the project dir will fix that issue
On Jun 2, 2013 3:06 PM, "militantwalrus" [email protected] wrote:

SuSE linux
64-bit python
64-bit Cython
ta-lib builds and installs to /usr/lib64/python2.7/site-packages/talib/

import talib
Traceback (most recent call last):
File "", line 1, in
File "talib/init.py", line 4, in
from . import common
ImportError: cannot import name common

Then I had a funny idea.... I was running the python shell in the
checkout dir.
Running the python shell elsewhere let me import talib just fine....

Just posting this in case it helps someone.

Thanks much for the module.


Reply to this email directly or view it on GitHubhttps://github.com//issues/37
.

from ta-lib-python.

no13bus avatar no13bus commented on May 10, 2024

so how do you resolve it??
In my mac, it does report this error.why??

from ta-lib-python.

mrjbq7 avatar mrjbq7 commented on May 10, 2024

Hi @no13bus are you getting a traceback similar to the message above? If so, perhaps you have not installed it correctly. You need to have the underlying C library as mentioned in the README, and then complete the installation of this python package by either easy_install TA-Lib (from PyPI) or python setup.py install (from a local git checkout).

from ta-lib-python.

no13bus avatar no13bus commented on May 10, 2024

@mrjbq7 yes.First I install cython, then the c-ta-lib, at last your project.But it still have error.

from ta-lib-python.

mrjbq7 avatar mrjbq7 commented on May 10, 2024

Hmm, that error indicates it can't import talib.common which is a cython module that is built as part of the installation process. Perhaps there were errors during installation? What OS platform are you trying this from?

from ta-lib-python.

no13bus avatar no13bus commented on May 10, 2024
$ sudo python setup.py install
running install
running build
running build_py
running build_ext
skipping 'talib/common.c' Cython extension (up-to-date)
skipping 'talib/func.c' Cython extension (up-to-date)
skipping 'talib/abstract.c' Cython extension (up-to-date)
running install_lib
running install_egg_info
Removing /Library/Python/2.7/site-packages/TA_Lib-0.4.8-py2.7.egg-info
Writing /Library/Python/2.7/site-packages/TA_Lib-0.4.8-py2.7.egg-inf

My platform is mac os 10.9.5.
in ipython,I type 'import cython', it do not have errors. It is correct.

from ta-lib-python.

no13bus avatar no13bus commented on May 10, 2024

this is the result after I type sudo python setup.py install

from ta-lib-python.

mrjbq7 avatar mrjbq7 commented on May 10, 2024

Are you trying to run Python inside of the ta-lib hit checkout? Perhaps when you"import talib" it used the talib files inside your checkout instead of the system ones?

from ta-lib-python.

no13bus avatar no13bus commented on May 10, 2024

so you mean I run python in the ta-lib source directory??I change another directory, but it does not work.Why?

from ta-lib-python.

mrjbq7 avatar mrjbq7 commented on May 10, 2024

If it works from the ta-lib source directory and not from somewhere else, then it means you built it correctly (and that it's working!) but didn't install it to Python's site-packages properly or there is some other configuration issue preventing its use with Python. I wish I could help but it sounds like it would require some more debugging of your local setup.

from ta-lib-python.

no13bus avatar no13bus commented on May 10, 2024

my command is sudo python setup.py install
this is the result:

$ sudo python setup.py install
Password:
running install
running build
running build_py
running build_ext
skipping 'talib/common.c' Cython extension (up-to-date)
skipping 'talib/func.c' Cython extension (up-to-date)
skipping 'talib/abstract.c' Cython extension (up-to-date)
running install_lib
creating /Library/Python/2.7/site-packages/talib
copying build/lib.macosx-10.9-intel-2.7/talib/__init__.py -> /Library/Python/2.7/site-packages/talib
copying build/lib.macosx-10.9-intel-2.7/talib/abstract.so -> /Library/Python/2.7/site-packages/talib
copying build/lib.macosx-10.9-intel-2.7/talib/common.so -> /Library/Python/2.7/site-packages/talib
copying build/lib.macosx-10.9-intel-2.7/talib/deprecated.py -> /Library/Python/2.7/site-packages/talib
copying build/lib.macosx-10.9-intel-2.7/talib/func.so -> /Library/Python/2.7/site-packages/talib
copying build/lib.macosx-10.9-intel-2.7/talib/test_abstract.py -> /Library/Python/2.7/site-packages/talib
copying build/lib.macosx-10.9-intel-2.7/talib/test_data.py -> /Library/Python/2.7/site-packages/talib
copying build/lib.macosx-10.9-intel-2.7/talib/test_func.py -> /Library/Python/2.7/site-packages/talib
byte-compiling /Library/Python/2.7/site-packages/talib/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.7/site-packages/talib/deprecated.py to deprecated.pyc
byte-compiling /Library/Python/2.7/site-packages/talib/test_abstract.py to test_abstract.pyc
byte-compiling /Library/Python/2.7/site-packages/talib/test_data.py to test_data.pyc
byte-compiling /Library/Python/2.7/site-packages/talib/test_func.py to test_func.pyc
running install_egg_info
Writing /Library/Python/2.7/site-packages/TA_Lib-0.4.8-py2.7.egg-info

And whether I type import talib in the source folder or not, it still have error as before

from ta-lib-python.

mrjbq7 avatar mrjbq7 commented on May 10, 2024

I'm not sure why your system site-packages wouldn't work, if this is the python that comes with OS X, I would expect to see it either:

  1. Load from site-packages:
$ cd ~
$ python
Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import talib
>>> talib.__file__
'/Library/Python/2.7/site-packages/TA_Lib-0.4.8-py2.7-macosx-10.9-intel.egg/talib/__init__.pyc'
  1. Load from my ta-lib project directory:
$ cd Dev/ta-lib
$ python
Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import talib
>>> talib.__file__
'talib/__init__.pyc'

I'm not sure what might be causing your problem, but somehow it indicates it is copying all the proper files into the proper places, but later somehow its not finding them. Maybe try deleting /Library/Python/2.7/site-packages/talib and /Library/Python/2.7/site-packages/TA_Lib-0.4.8-py2.7.egg-info and then try running make clean and python setup.py install from the ta-lib project directory?

from ta-lib-python.

mrjbq7 avatar mrjbq7 commented on May 10, 2024

By any chance, did you upgrade to Yosemite recently? I have seen a similar error importing from the ta-lib project directory, a make clean, make, make test showed the error to go away. Just an idea...

from ta-lib-python.

no13bus avatar no13bus commented on May 10, 2024

thanks a lot for your help. I did this: deleting /Library/Python/2.7/site-packages/talib and /Library/Python/2.7/site-packages/TA_Lib-0.4.8-py2.7.egg-info and then try running make clean and python setup.py install from the ta-lib project directory.And it stil have the errors as before. And now my mac osx version is 10.9.5

from ta-lib-python.

no13bus avatar no13bus commented on May 10, 2024

thanks very much.It worked.
I type make test,then I get the errors about the numpy errors. Then I uninstall the numpy, and I reinstall numpy, It worked.
ThanksThanksThanksThanksThanksThanksThanksThanksThanksThanksThanksThanksThanks......
You are very nice.

from ta-lib-python.

mrjbq7 avatar mrjbq7 commented on May 10, 2024

@no13bus Oh good! Sorry it took so long to get working, I'm not sure what exactly was the problem, but so glad you resolved it! Let me know if you have any feedback as you start using these bindings!

from ta-lib-python.

no13bus avatar no13bus commented on May 10, 2024

No,NO. It's my fault.I am not very familiar with the linux command. I should type the make test. Actually I use the macd and other index to analysis the bitcoin trade. I want to achieve the website like this: https://bitcoinwisdom.com/
thanks again. If I come cross some errors, I will report issue for you.

from ta-lib-python.

 avatar commented on May 10, 2024

I tried this and it finally worked for me on my MAC air, running OSX 10.8.5.

sudo pip install cython
sudo pip install numpy

downloaded: ta-lib-0.4.0-src.tar.gz

$ untar and cd
$ ./configure --prefix=/Library
$ make
$ make clean
$ sudo make install
$ brew install ta-lib

notice the prefix to /Library, and then the make clean before make install.

from ta-lib-python.

mrjbq7 avatar mrjbq7 commented on May 10, 2024

@babalusobral I'm sorry you had problems, I'm not sure what your python situation is, but this is all you should need on a fresh Mac OS X install using the system Python:

$ brew install ta-lib
$ pip install ta-lib

from ta-lib-python.

 avatar commented on May 10, 2024

@mrjbq7 Thanks for your support mate. Definately some screw up on my part. I'm new to MAC and don't know how things work and where things are etc.... probably why i was having difficulties in installing. It works great now. Thumbs up to you man.

from ta-lib-python.

dpk011 avatar dpk011 commented on May 10, 2024

@mrjbq7 Thank for the solution on Yosemite. It worked!!!!

from ta-lib-python.

girigk avatar girigk commented on May 10, 2024

I did below steps and it worked perfectly well. I was getting error -
cannot import name 'TA_FUNCTION_NAMES'

  1. Closed anaconda
  2. Went into site packages folder and found talib folders
  3. Deleted the folders
  4. Opened Anaconda prompt
  5. Upgraded numpy - pip install -U numpy --user
  6. Installed TA_Lib-0.4.17-cp36-cp36m-win_amd64.whl which I had downloaded using pip install
    This

from ta-lib-python.

mrjbq7 avatar mrjbq7 commented on May 10, 2024

Closing all installation issues, if someone has a specific problem please open a new one.

from ta-lib-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.