invenia / SyntheticGrids.jl

Julia package for building synthetic power grids
MIT License
28 stars 10 forks source link

Failure to build on Windows CI machines #18

Open mattBrzezinski opened 5 years ago

mattBrzezinski commented 5 years ago

SyntheticGrids will not build on Windows CI machines. Conda.jl does not activate the base Conda enviornment which is needed to path map DLLs properly.

According to Conda.jl Issue #119 the following line needs to be added to deps/build.jl so that the Conda bin directory is mapped properly.

ENV["PATH"] = "$(Conda.BINDIR);$(ENV["PATH"])" # Add Conda.BINDIR to pathing so DLLs map on Windows

This resolves on issue, however after submitting a new job the error below appears. I've tried various solutions of different SyntheticGrid dependencies which have not helped or let to dead ends. This does not seem to be an issue with numpy but with pathing to it.

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
# All requested packages already installed.
ERROR: LoadError: InitError: PyError (PyImport_ImportModule
The Python package pandapower could not be found by pyimport. Usually this means
that you did not install pandapower in the Python version being used by PyCall.
PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package.  To install the pandapower module, you can
use `pyimport_conda("pandapower", PKG)`, where PKG is the Anaconda
package the contains the module pandapower, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).
Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python.   As explained in the PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.
) <class 'ImportError'>
ImportError('\n\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\n\nImporting the numpy c-extensions failed.\n- Try uninstalling and reinstalling numpy.\n- If you have already done that, then:\n  1. Check that you expected to use Python3.6 from "C:\\julia\\bin\\julia.exe",\n     and that you have no directories in your PATH or PYTHONPATH that can\n     interfere with the Python and numpy version "1.17.0" you\'re trying to use.\n  2. If (1) looks fine, you can open a new issue at\n     https://github.com/numpy/numpy/issues.  Please include details on:\n     - how you installed Python\n     - how you installed numpy\n     - your operating system\n     - whether or not you have multiple versions of Python installed\n     - if you built from source, your compiler versions and ideally a build log\n\n- If you\'re working with a numpy git repository, try `git clean -xdf`\n  (removes all files not under version control) and rebuild numpy.\n\nNote: this error has many possible causes, so please don\'t comment on\nan existing issue about this - open a new one instead.\n\nOriginal error was: DLL load failed: The specified module could not be found.\n',)
  File "C:\Users\travis\.julia\conda\3\lib\site-packages\pandapower\__init__.py", line 6, in <module>
    from pandapower.auxiliary import *
  File "C:\Users\travis\.julia\conda\3\lib\site-packages\pandapower\auxiliary.py", line 31, in <module>
    import numpy as np
  File "C:\Users\travis\.julia\conda\3\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import core
  File "C:\Users\travis\.julia\conda\3\lib\site-packages\numpy\core\__init__.py", line 47, in <module>
    raise ImportError(msg)

Notes