convexengineering / gpkit

Geometric programming for engineers
http://gpkit.readthedocs.org
MIT License
206 stars 40 forks source link

Fresh install: name 'long' is not defined (dependency issue) #1558

Closed pgkirsch closed 3 years ago

pgkirsch commented 3 years ago

Fresh installation on a new laptop. Cloned gpkit repo and ran tests (using python 3.9.7), returned a NameError. Looks like the problem is with the ad package but creating a ticket here for tracking.

[~/Software/gpkit][15:24:23]((HEAD detached at 04fb19d))$ python -c "import gpkit.tests; gpkit.tests.run()"
Found no installed solvers, beginning a build.
# Building GPkit version 1.0.0pre
# Moving to the directory from which GPkit was imported.

Attempting to find and build solvers:

# Looking for `mosek_cli`
#   (A "success" is if mskexpopt complains that
#    we haven't specified a file for it to open.)
#     Calling 'mskexpopt'
##
### CALL BEGINS
/bin/sh: mskexpopt: command not found
### CALL ENDS
##
# Looks like `mskexpopt` was not found in the default PATH,
#  so let's try locating that binary ourselves.
# expected MOSEK directory not found: /Users/philippe.kirschen/mosek
# Did not find
# mosek_cli

# Looking for `mosek_conif`
#   Trying to import mosek...

Found mosek_conif in the default PYTHONPATH

# Looking for `cvxopt`
#   Trying to import cvxopt...

Found cvxopt in the default PYTHONPATH

Found the following solvers: mosek_conif, cvxopt
#     Replacing directory env
/Users/philippe.kirschen/Software/gpkit/gpkit/small_scripts.py:71: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if sweep is "sweep" and (isinstance(value, Iterable) or  # pylint: disable=literal-comparison
/Users/philippe.kirschen/Software/gpkit/gpkit/nomials/math.py:586: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if posy is 0:  # pylint: disable=literal-comparison
/Users/philippe.kirschen/Software/gpkit/gpkit/nomials/math.py:590: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if negy is 0:  # pylint: disable=literal-comparison
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/philippe.kirschen/Software/gpkit/gpkit/__init__.py", line 19, in <module>
    from .constraints.model import Model
  File "/Users/philippe.kirschen/Software/gpkit/gpkit/constraints/model.py", line 5, in <module>
    from .prog_factories import progify, solvify
  File "/Users/philippe.kirschen/Software/gpkit/gpkit/constraints/prog_factories.py", line 5, in <module>
    from ad import adnumber
  File "/Users/philippe.kirschen/opt/anaconda3/envs/hops/lib/python3.9/site-packages/ad/__init__.py", line 25, in <module>
    CONSTANT_TYPES = (float, int, long, complex)
NameError: name 'long' is not defined
pgkirsch commented 3 years ago

Hmm looks like I'm only able to install an old version of ad for some reason. Definitely not a gpkit issue so I'll close.

pgkirsch commented 3 years ago

Created an issue in the ad repo.

whoburg commented 3 years ago

Great catch... hmm, if ad is a dependency, shouldn't we lock the version to something that works, until this is fixed on their side? We could include a comment in setup.py reminding us to unlock eventually.

pgkirsch commented 3 years ago

Yes although I believe what needs to be fixed is the version of setuptools (<58) and I don't know if that's too meta to do in setup.py...

bqpd commented 3 years ago

hmm, if we specify a minimum ad version it'll at least not install it when that happens; 1.3.2 seems to work on py.3.5.2, so I'll specify ad >= 1.3.2