creare-com / pydem

Python library for Global Hydrology Analysis. Used to calculate upstream contributing area, aspect, slope, and topographic wetness index.
Apache License 2.0
114 stars 35 forks source link

Installation error: Microsoft Visual C++ 14.0 is required. #16

Closed leblancfg closed 6 years ago

leblancfg commented 6 years ago

Hi all. I get the following errors when trying to install PyDEM from pip on Windows, with the Anaconda distribution of Python:

Running setup.py bdist_wheel for pyDEM: finished with status 'error'
[...]
building 'pydem.cyfuncs.cyutils' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

...which I can't install on this corporate computer. I assume I'll get the same issue trying to build from source too.

Might I suggest you look into the following for an eventual release? Would be interesting to:

  1. Upload pre-built wheels to pypi, and/or
  2. Create a conda-forge recipe for the anaconda distribution.

Cheers!

mpu-creare commented 6 years ago

You could try:

conda install mingw libpython

and then reinstalling via pip.

leblancfg commented 6 years ago

Thanks for the quick repsonse!

Doesn't work either. I get:

  Running setup.py bdist_wheel for pyDEM: started
  Running setup.py bdist_wheel for pyDEM: finished with status 'error'
  Complete output from command c:\users\leblancfr\appdata\local\continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\LEBLAN~1\\AppData\\Local\\Temp\\1\\pip-build-43jfa545\\pyDEM\\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 C:\Users\LEBLAN~1\AppData\Local\Temp\1\tmpquksfvrdpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\pydem
  copying pydem\commandline_utils.py -> build\lib.win-amd64-3.6\pydem
  copying pydem\dem_processing.py -> build\lib.win-amd64-3.6\pydem
  copying pydem\processing_manager.py -> build\lib.win-amd64-3.6\pydem
  copying pydem\test_pydem.py -> build\lib.win-amd64-3.6\pydem
  copying pydem\utils.py -> build\lib.win-amd64-3.6\pydem
  copying pydem\__init__.py -> build\lib.win-amd64-3.6\pydem
  creating build\lib.win-amd64-3.6\pydem\cyfuncs
  copying pydem\cyfuncs\__init__.py -> build\lib.win-amd64-3.6\pydem\cyfuncs
  creating build\lib.win-amd64-3.6\pydem\reader
  copying pydem\reader\gdal_reader.py -> build\lib.win-amd64-3.6\pydem\reader
  copying pydem\reader\my_types.py -> build\lib.win-amd64-3.6\pydem\reader
  copying pydem\reader\__init__.py -> build\lib.win-amd64-3.6\pydem\reader
  creating build\lib.win-amd64-3.6\pydem\taudem
  copying pydem\taudem\taudem.py -> build\lib.win-amd64-3.6\pydem\taudem
  copying pydem\taudem\__init__.py -> build\lib.win-amd64-3.6\pydem\taudem
  running build_ext
  error: [WinError 2] The system cannot find the file specified
mpu-creare commented 6 years ago

Well that's bizarre. What version of python / conda are you using? can you post your conda environment .yml file? conda env export > environment.yml (preferably a minimal set)

Note: pydem is python 2.7 only.

Basically pydem compiles a few functions using cython -- for speed. By default conda looks for the microsoft compiler on windows, but you can get minimum gcc for windows (mingw) and the needed header files (libpython) to do the compilation step.

Your error traceback unfortunately doesn't tell me much -- I'm not sure what file is missing. I also checked, seems like I did build a wheel for windows, but it's hard to cover all cases.

leblancfg commented 6 years ago

Note: pydem is python 2.7 only.

There it is. Sorry about the confusion!