Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pgkirsch opened this issue Oct 15, 2021 · 5 comments · Fixed by #1561
Closed

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

pgkirsch opened this issue Oct 15, 2021 · 5 comments · Fixed by #1561

Comments

@pgkirsch
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor Author

Created an issue in the ad repo.

@whoburg
Copy link
Collaborator

whoburg commented Oct 16, 2021

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.

@whoburg whoburg reopened this Oct 16, 2021
@pgkirsch
Copy link
Contributor Author

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
Copy link
Contributor

bqpd commented Oct 19, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants