peterdsharpe / AeroSandbox

Aircraft design optimization made fast through modern automatic differentiation. Composable analysis tools for aerodynamics, propulsion, structures, trajectory design, and much more.
https://peterdsharpe.github.io/AeroSandbox/
MIT License
690 stars 111 forks source link

Problems installing on a Mac #24

Closed KikeM closed 4 years ago

KikeM commented 4 years ago

Describe the bug The installation seems to break for xfoil.

So it is actually not an AeroSandbox bug, but one of its dependencies.

I wonder if xfoil is mandatory for the VLM, or it could be set up as an optional install only required for certain features (I have seen this in pandas with Excel sheets).

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/peterdsharpe/AeroSandbox.git
  2. cd AeroSandbox
  3. pip install -e .

Expected behavior Clean installation.

Screenshots

Building wheels for collected packages: xfoil
  Running setup.py bdist_wheel for xfoil ... error
  Complete output from command /Users/Kike/anaconda/envs/aerosandbox/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-wheel-z9nqcwl6 --python-tag cp36:
  /Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'zip_save'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.6
  creating build/lib.macosx-10.9-x86_64-3.6/xfoil
  copying xfoil/xfoil.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
  copying xfoil/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
  copying xfoil/test.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
  copying xfoil/model.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
  running build_ext
  @(#)PROGRAM:ld  PROJECT:ld64-409.12
  BUILD 17:47:51 Sep 25 2018
  configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em arm64e arm64_32
  LTO support using: LLVM version 10.0.0, (clang-1000.11.45.5) (static support for 21, runtime is 21)
  TAPI support using: Apple TAPI version 10.0.0 (tapi-1000.11.8.2)
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/setup.py", line 149, in <module>
      zip_save=False
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 87, in run
      _build_ext.run(self)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/command/build_ext.py", line 308, in run
      force=self.force)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/ccompiler.py", line 1031, in new_compiler
      return klass(None, dry_run, force)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cygwinccompiler.py", line 285, in __init__
      CygwinCCompiler.__init__ (self, verbose, dry_run, force)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cygwinccompiler.py", line 129, in __init__
      if self.ld_version >= "2.10.90":
  TypeError: '>=' not supported between instances of 'NoneType' and 'str'

  ----------------------------------------
  Failed building wheel for xfoil
  Running setup.py clean for xfoil
Failed to build xfoil
Installing collected packages: numpy, casadi, six, retrying, plotly, xfoil, AeroSandbox
  Running setup.py install for xfoil ... error
    Complete output from command /Users/Kike/anaconda/envs/aerosandbox/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-record-qfdiogyh/install-record.txt --single-version-externally-managed --compile:
    /Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'zip_save'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.6
    creating build/lib.macosx-10.9-x86_64-3.6/xfoil
    copying xfoil/xfoil.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
    copying xfoil/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
    copying xfoil/test.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
    copying xfoil/model.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
    running build_ext
    @(#)PROGRAM:ld  PROJECT:ld64-409.12
    BUILD 17:47:51 Sep 25 2018
    configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em arm64e arm64_32
    LTO support using: LLVM version 10.0.0, (clang-1000.11.45.5) (static support for 21, runtime is 21)
    TAPI support using: Apple TAPI version 10.0.0 (tapi-1000.11.8.2)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/setup.py", line 149, in <module>
        zip_save=False
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
        return distutils.core.setup(**attrs)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 87, in run
        _build_ext.run(self)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/command/build_ext.py", line 308, in run
        force=self.force)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/ccompiler.py", line 1031, in new_compiler
        return klass(None, dry_run, force)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cygwinccompiler.py", line 285, in __init__
        CygwinCCompiler.__init__ (self, verbose, dry_run, force)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cygwinccompiler.py", line 129, in __init__
        if self.ld_version >= "2.10.90":
    TypeError: '>=' not supported between instances of 'NoneType' and 'str'

    ----------------------------------------
Command "/Users/Kike/anaconda/envs/aerosandbox/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-record-qfdiogyh/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/

Desktop (please complete the following information):

peterdsharpe commented 4 years ago

Yes! This is a known issue that I thought I had fixed, but clearly I missed something!

You're exactly right in that xfoil is an optional feature that lets you do some convenient things with the AeroSandbox.Airfoil class (namely, get XFoil data). I thought I had removed xfoil as a hard dependency last week for exactly that reason, but apparently that didn't happen!

I'm curious why pip is even trying to install xfoil when you run pip install -e . for AeroSandbox, as xfoil is no longer in requirements.txt or in setup.py's install_requires=[] list... Do you have any ideas?

KikeM commented 4 years ago

Found it!

https://github.com/peterdsharpe/AeroSandbox/search?q=xfoil&unscoped_q=xfoil

https://github.com/peterdsharpe/AeroSandbox/blob/854aee40c526455c1e8518a115050921303b336e/setup.py#L144

I have fixed it, but I cannot push new branches to your repository.

Should I fork it and fix it there or do you want to allow for other users to create new branches? (but not have rights to push to master).

KikeM commented 4 years ago

See https://github.com/peterdsharpe/AeroSandbox/pull/25