Skip to content

Commit

Permalink
Try again
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Jan 7, 2025
1 parent 5f36933 commit d026e65
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
25 changes: 24 additions & 1 deletion pyomo/contrib/interior_point/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,30 @@

from abc import ABCMeta, abstractmethod
from pyomo.contrib.pynumero.interfaces import pyomo_nlp, ampl_nlp
from pyomo.contrib.pynumero.sparse import BlockMatrix, BlockVector
try:
from pyomo.contrib.pynumero.sparse import BlockVector, BlockMatrix
except ImportError as e:
print("IMPORT ERROR: ", e)
print("Current environment information...")
import sys
import platform
import pkg_resources

print(f"Python version: {platform.python_version()}")
print(f"Python executable: {sys.executable}")
print(f"Platform: {platform.system()} {platform.release()} ({platform.platform()})")

print("\nInstalled packages:")
installed_packages = pkg_resources.working_set
installed_packages_list = sorted(
[f"{pkg.key}=={pkg.version}" for pkg in installed_packages]
)
print("\n".join(installed_packages_list))

print("\nImported packages:")
imported_packages = sorted(sys.modules.keys())
print("\n".join(imported_packages))
raise e
import numpy as np
import scipy.sparse
from pyomo.common.timing import HierarchicalTimer
Expand Down
8 changes: 3 additions & 5 deletions pyomo/contrib/pynumero/linalg/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
from scipy.sparse import spmatrix
import numpy as np

from pyomo.contrib.pynumero.sparse.base_block import BaseBlockVector, BaseBlockMatrix

try:
from pyomo.contrib.pynumero.sparse.base_block import (
BaseBlockVector,
BaseBlockMatrix,
)
from pyomo.contrib.pynumero.sparse import BlockVector, BlockMatrix
except ImportError as e:
print("IMPORT ERROR: ", e)
print("Current environment information...")
Expand All @@ -42,7 +41,6 @@
imported_packages = sorted(sys.modules.keys())
print("\n".join(imported_packages))
raise e
from pyomo.contrib.pynumero.sparse import BlockVector, BlockMatrix


class LinearSolverStatus(enum.Enum):
Expand Down

0 comments on commit d026e65

Please sign in to comment.