Cannot install Cython on win7

前端 未结 1 331
遥遥无期
遥遥无期 2021-01-13 05:55

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 p

1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-13 06:40

    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 ;-)

    0 讨论(0)
提交回复
热议问题