htm.core from git installation issues

136 views Asked by At

I am using conda 4.8.5 on Windows 10 and I have Python 3.8.5. My goal is to successfully install the htm.core from github based on the nicely laid out steps on that page. I expected this installation to go smoothly after hours of updating anaconda and python. The actual result is that I am stuck at the step of python setup.py install.

I am getting an error I do not see others struggling with anywhere among the posts of github and stackoverflow (it's below). I am very confused because I am not using Visual Studio, but there seems to be some sort of issue with it from the cpp files that setup.py references. I took a look at the tolower function in the errors, and it does expect 2 arguments. However, I do not have access to the LibrarySource.vcxproj file to check out where it is called. Also, I'm not sure why I would need to access any of these files if they are the behind-the-scenes-for-the-build files. Furthermore, I'm not even sure if this is the real issue. However, I cannot understand the subprocess error (I updated cmake for this installation). Thank you in advance for your help.

DateEncoder.cpp
c:\users\l\htm.core\src\htm\encoders\dateencoder.cpp(121): error C2672: 'std::tolower': no matching overloaded function found [C:\Users\l\htm.core\build\scripts\src\LibrarySource.vcxproj]
c:\users\l\htm.core\src\htm\encoders\dateencoder.cpp(121): error C2780: '_Elem std::tolower(_Elem,const std::locale &)': expects 2 arguments - 1 provided [C:\Users\l\htm.core\build\scripts\src\LibrarySource.vcxproj]
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.16.27023\include\locale(274): note: see declaration of 'std::tolower'

Traceback (most recent call last):
File "setup.py", line 374, in
   getExtensionFiles(platform, build_type)
File "setup.py", line 239, in getExtensionFiles
   generateExtensions(platform, build_type)
File "setup.py", line 288, in generateExtensions
   subprocess.check_call(["cmake", "--build", ".", "--target", "install", "--config", build_type])
File "C:\Users\l\anaconda3\lib\subprocess.py", line 364, in check_call
   raise CalledProcessError(retcode, cmd)
   subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release']' returned non-zero exit status 1.

The htm.core folder is stored in C:\Users\l and my Anaconda is stored in C:\Users\l\anaconda3.

1

There are 1 answers

0
user1723196 On

I discovered the solution to my issue with some help from dkeeney over on the github page. It seems that the programming in htm.core does require Visual Studio, even if I am not using it directly. I had VS2017 BuildTools installed previously, and they are needed (there will be a buildtools error if these are completely removed or missing, they are a dependency)! I also installed the community version 2019 alongside VS2017 BuildTools. If you don't have them, you can find them on stackoverflow here. However, for this to resolve the issue, I had to delete my current installation of htm.core and then clone it once more. I ran python setup.py install, and it ran successfully! I even ran the tests, and 171 passed, 4 skipped, and this was all done in 88.64 seconds. I recommend to have your Python up-to-date, your anaconda up-to-date (if this is your route), VS2017 buildtools, and VS2019 community installed properly before downloading htm.core and attempting to install it. I hope someone finds this useful someday.