Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install Cython on win7

Tags:

python

cython

So I'm trying to use Cython on ta-lib, and I'm using the wrapper provided by mrjbq7 (many thanks..). So I tried to install Cython-0.19.1 on my computer and then do python setup.py install on ta-lib-master (the wrapper), and I got the following:

    running install
    running build
    running build_py
    running biuld_ext
    failed to import Cython: No module named 'Actions'
    error: Cython does not appear to be installed

I tried to build Cython with python setup.py build_ext --inplace

Can anyone please help me? Thanks a lot!


I'm using 32-bit Windows7 and python 3.3.1

like image 347
Tengyu Liu Avatar asked Oct 03 '22 22:10

Tengyu Liu


1 Answers

I don't think your troubles have anything to do with the fact that you're installing the TA-lib wrapper, so here are a few suggestions :

  • First, retry to install Cython using Python 2.7.X (I suspect some incompatibilities between some Python versions and Cython versions : at least, the kind of errors you mentioned remind me something...).

If this doesn't help, rebuild Cython as follows :

  1. Install MinGW (with options gcc/g++) from here.
  2. Tell disutils to use gcc... Create file C:\Python27\Lib\distutils\distutils.cfg and write this inside :

    [build]
    compiler = mingw32
    
  3. If needed, remove all instances of -mno-cygwin gcc option from file C:\Python27\Lib\distutils\cygwinccompiler.py :

    # self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
                         # compiler_so='gcc -mno-cygwin -mdll -O -Wall',
                         # compiler_cxx='g++ -mno-cygwin -O -Wall',
                         # linker_exe='gcc -mno-cygwin',
                         # linker_so='%s -mno-cygwin %s %s'
                                    # % (self.linker_dll, shared_option,
                                       # entry_point))
    # becomes :
    
    self.set_executables(compiler='gcc -O -Wall',
                         compiler_so='gcc -mdll -O -Wall',
                         compiler_cxx='g++ -O -Wall',
                         linker_exe='gcc',
                         linker_so='%s %s %s'
                                    % (self.linker_dll, shared_option,
                                       entry_point))
    
    # Just because `-mno-cygwin` has just been removed from early versions of gcc.
    
  4. Build and install Cython : $ python setup.py install

In any cases : Make sure to have the proper PATHs for Cython :

SET PYTHONPATH=%PYTHONPATH%;../../../DEPENDENCIES/Cython-0.19.1
SET PATH=%PATH%;../../../DEPENDENCIES/Cython-0.19.1/bin

Try rebuilt TA-lib and please tell me what it says ;-)

like image 106
Gauthier Boaglio Avatar answered Oct 12 '22 11:10

Gauthier Boaglio