Page 1 of 1

Both CLASS and Hi_class installing error

Posted: June 23 2020
by TUMURTUSHAA GANSUKH
Dear All,

I have the same installing problem with both CLASS and Hi_Class. Please, refer to the attached image for an error message that I got. Previously, I had no problem with the installation of both codes, but this time I do not know what I have been doing wrong. Could anyone help or provide me with a solution to the error.

Thank you in advance.

P.S: I have been trying to install on macOS Catalina (10.15.5), where gcc-4.9 is also installed.


Best,
Gansukh. T

Re: Both CLASS and Hi_class installing error

Posted: June 24 2020
by Tanvi Karwal
Do you have cython installed? If you do

Code: Select all

python -c "import cython"
in your terminal, does it give you an error or does it succeed?

Re: Both CLASS and Hi_class installing error

Posted: June 24 2020
by TUMURTUSHAA GANSUKH
First of all, thank you for your comment.

Yes, I have "Cython version 0.29.20" installed as you can see in the attached image, and "python -c "import cython" seems to be okay since it does not compile to an error.

Do you think there is some incompatibility kind of issue with upgraded macOS?

Re: Both CLASS and Hi_class installing error

Posted: June 27 2020
by Tanvi Karwal
The error seems to come from

Code: Select all

from Cython.Distutils import build_ext
right?

Does that command work for your python? If not, you could try updating your cython / using anaconda python.
If you don't need the python wrapper, you can check that CLASS itself works, without the python wrapper - instead of 'make', run 'make class'.

Re: Both CLASS and Hi_class installing error

Posted: June 29 2020
by TUMURTUSHAA GANSUKH
Dear Tanvi Karwal,

Thank you for your kind help.

At first,

Code: Select all

from Cython.Distutils import build_ext 
compiled into an error hence I took your advice and have updated the Cython using anaconda. Now it seems there is no python related error because

Code: Select all

make clean; make

command gives the following lines at the end:

Code: Select all

2 warnings generated.
creating build/lib.macosx-10.9-x86_64-3.7
gcc -bundle -undefined dynamic_lookup -L/opt/anaconda3/lib -arch x86_64 -L/opt/anaconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.9-x86_64-3.7/Users/R1007/Documents/hi_class_public/python/../python/classy.o -L/Users/R1007/Documents/hi_class_public/python/.. -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/lib/darwin19.5.0 -lclass -o build/lib.macosx-10.9-x86_64-3.7/classy.cpython-37m-darwin.so -lgomp
ld: warning: directory not found for option '-L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/lib/darwin19.5.0'
running install_lib
copying build/lib.macosx-10.9-x86_64-3.7/classy.cpython-37m-darwin.so -> /opt/anaconda3/lib/python3.7/site-packages
running install_egg_info
Removing /opt/anaconda3/lib/python3.7/site-packages/classy-2.7.2-py3.7.egg-info
Writing /opt/anaconda3/lib/python3.7/site-packages/classy-2.7.2-py3.7.egg-info
rm python/autosetup.py
However, when I try "import classy" from python, I got the following error message

Code: Select all

 
$ python
Python 3.7.7 (default, Mar 10 2020, 15:43:33) 
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import classy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'classy'
>>> import classy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'classy'
>>>  
and do you have any idea what could possibly be causing it?

Thank you in advance.

Gansukh T

Re: Both CLASS and Hi_class installing error

Posted: June 29 2020
by Tanvi Karwal
I'm not sure, but more quick things to check:
- Check if this file actually exists

Code: Select all

/opt/anaconda3/lib/python3.7/site-packages/classy-2.7.2-py3.7.egg-info
- Check if you're calling classy from the same python that you used to build it - i.e.

Code: Select all

which python
should return the anaconda3 installation.

I'm also surprised you got class to install using clang? Maybe it's because I tried on a much older Mac, but clang wouldn't cooperate with openmpi for me and I had to get gcc. But that's neither here nor there. Have you looked through the issues on GitHub for any matches of your problem?

Re: Both CLASS and Hi_class installing error

Posted: June 30 2020
by TUMURTUSHAA GANSUKH
Thank you for your prompt reply. I have just checked the suggestions you made.

Yes, there exists

Code: Select all

/opt/anaconda3/lib/python3.7/site-packages/classy-2.7.2-py3.7.egg-info
and it seems I am calling classy from

Code: Select all

/usr/local/lib/python3.7/site-packages (0.0.9.2)
while "which python" returns to

Code: Select all

/opt/anaconda3/bin/python
I think it is worth mentioning that I had installed python 3.7 prior to installing anaconda (which I just did yesterday). So, I suspect there might be a path defining issue when it calls python (and its libraries). Here, I am not sure whether I am calling classy is from previously installed python 3.7 or from anaconda3.

If that matters, I am using the MacBook (Late 2013). It is the same here that the clang does not cooperate with OPENMPI hence I also use GCC and GCC version that I am using is:

Code: Select all

$ gcc --version
gcc-4.9 (Homebrew GCC 4.9.4_2) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
For me, GCC seems to be fine because there is no issue with "make class".

Lastly, I followed Github issues and, as you may know, there were no issues related to classy mentioned. To me, it seems there is an issue with my python and I am not being able to figure that out...

Re: Both CLASS and Hi_class installing error

Posted: June 30 2020
by TUMURTUSHAA GANSUKH
I think the problem is solved. I was messed up with python versions. Finally, I set up my python as anaconda and updated my gcc to gcc-7 and it worked.

Thank you for your kind help!