3

Python拡張機能(hydroclimpy.sourceforge.net)をインストールしようとしていますが、インストールする前に、Fortranをコンパイルする必要があるようです。拡張機能のビルドコマンドを実行すると、適切なFortranコンパイラが見つからないというエラーが表示されます。

$ c:/Python27/Python.exe setup.py build
non-existing path in 'scikits\\hydroclimpy': 'hydroclimpyrc.template'
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "scikits.hydroclimpy.stats._lmoments" sources
f2py options: []
  adding 'build\src.win32-2.7\fortranobject.c' to sources.
  adding 'build\src.win32-2.7' to include_dirs.
  adding 'build\src.win32-2.7\scikits\hydroclimpy\stats\_lmoments-f2pywrappers.f' to sources.
building data_files sources
build_src: building npy-pkg config files
running build_py
running build_ext
No module named msvccompiler in numpy.distutils; trying from distutils
customize MSVCCompiler
customize MSVCCompiler using build_ext
customize GnuFCompiler
Found executable C:\cygwin\bin\g77.exe
gnu: no Fortran 90 compiler found
gnu: no Fortran 90 compiler found
Found executable C:\cygwin\bin\g77.exe
customize IntelVisualFCompiler
Could not locate executable ifort
Could not locate executable ifl
customize AbsoftFCompiler
Could not locate executable f90
Found executable C:\cygwin\bin\f77.exe
absoft: no Fortran 90 compiler found
absoft: no Fortran 90 compiler found
customize CompaqVisualFCompiler
Found executable C:\cygwin\bin\DF.exe
Found executable C:\cygwin\bin\DF.exe
customize IntelItaniumVisualFCompiler
Could not locate executable efl
customize Gnu95FCompiler
Found executable C:\cygwin\bin\gfortran.exe
Found executable C:\cygwin\bin\gfortran.exe
customize G95FCompiler
Could not locate executable g95
customize IntelEM64VisualFCompiler
customize IntelEM64TFCompiler
Could not locate executable efort
Could not locate executable efc
don't know how to compile Fortran code on platform 'nt'
warning: build_ext: f77_compiler=None is not available.

building 'scikits.hydroclimpy.stats._lmoments' extension
error: extension 'scikits.hydroclimpy.stats._lmoments' has Fortran sources but no Fortran compiler found

私のマシンはCygwinを搭載したWindowsXPボックスです。Setuptoolsがインストールされました。私はg95と、Fortranに関連していると思われるCygwinのインストールリストで見つけた他のものをインストールしました。/ usr / local / binは、g95とgfortranを示しています。

$ ls -l /usr/local/bin/
total 159
lrwxrwxrwx 1 James None     52 Nov 13 14:07 cc1 -> /usr/local/lib/gcc-lib/i686-pc-cygwin/4.1.2/f951.
exe
lrwxrwxrwx 1 James None     37 Nov 13 14:07 g95 -> /usr/local/bin/i686-pc-cygwin-g95.exe
lrwxrwxrwx 1 James None     36 Aug 23 11:54 gfortran -> /usr/local/gfortran/bin/gfortran.exe
-rwxr-xr-x 1 James None 158895 Nov 13 14:07 i686-pc-cygwin-g95.exe

この拡張機能のセットアップスクリプトが期待どおりに機能するように、このマシンのFortranの状況を整理するために、他に何か提案できますか?

この拡張機能のセットアップスクリプトが役立つ場合は、次のとおりです。

"""
:mod:`scikits.hydroclimpy`
--------------------------

A collection of tools to manipulate environmental and climatologic time series.

setuptools must be installed first. If you do not have setuptools installed
please download and install it from http://pypi.python.org/pypi/setuptools
"""

version = '0.67.1'

classifiers = ['Development Status :: 4 - Beta',
               'Intended Audience :: Science/Research',
               'Intended Audience :: Developers',
               'License :: OSI Approved :: BSD License',
               'Operating System :: Microsoft :: Windows',
               'Operating System :: POSIX',
               'Operating System :: Unix',
               'Operating System :: MacOS',
               'Programming Language :: C',
               'Programming Language :: Python',
               'Topic :: Education',
               'Topic :: Scientific/Engineering',
               'Topic :: Software Development',
              ]

distname = 'scikits.hydroclimpy'

long_description = """
The scikits.hydroclimpy module is a collection of tools for manipulating and 
plotting environmental time series of various frequencies. This package is 
an extension for scikits.timeseries, focusing on tools for the analysis of
hydroclimatologic datasets.
"""

import os
import sys
import setuptools
from numpy.distutils.core import setup, Extension


def configuration(parent_package='',top_path=None):
    from numpy.distutils.misc_util import Configuration
    config = Configuration(None, parent_package, top_path,
                           namespace_packages=['scikits'])

    config.set_options(ignore_setup_xxx_py=True,
                       assume_default_configuration=True,
                       delegate_options_to_subpackages=True,
                       quiet=True,
    )

    config.add_subpackage('scikits')
    config.add_subpackage('doc')
    config.add_subpackage('examples')
    config.add_subpackage(distname)
    config.add_data_files('scikits/__init__.py')

    return config

package_data = {'': 'hydroclimpyrc'}

def setup_package():

    setup(
          install_requires=['numpy > 1.2.5',
                            'scipy >= 0.7',
                            'scikits.timeseries >= 0.91'],
          namespace_packages=['scikits'],
          packages=setuptools.find_packages(),
          test_suite = 'nose.collector',
          name = distname,
          version = version,
          description = "Environmental time series manipulation",
          long_description = long_description,
          license = "BSD",
          author = "Pierre GF GERARD-MARCHANT",
          author_email = "pierregmcode_AT_gmail_DOT_com",
          maintainer = "Pierre GF GERARD-MARCHANT",
          maintainer_email = "pierregmcode_AT_gmail_DOT_com",
          url = "http://hydroclimpy.sourceforge.net",
          classifiers = classifiers,
          platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
          configuration = configuration,
    )

    return

if __name__ == '__main__':
    setup_package()
4

2 に答える 2

0

別の傾斜からの代替案:cygwinのような問題を回避し、XPボックスで* nixのような環境を取得しようとする方法のひとつは、思い切ってLinuxを使用することです。デュアルブート、ライブLinux、またはそれを実行する方法など、これを行う方法はたくさんあります。

于 2012-11-29T06:50:57.400 に答える
0

この python bugにパッチを適用してみてください。これにより、説明したのとまったく同じエラーに遭遇した後、ソースから numpy をビルドできました。

注: 私は VS2010 でコンパイルしています。すべての Python 拡張機能にも使用する必要があります。

于 2014-07-25T12:26:18.103 に答える