cyclops-community / ctf

Cyclops Tensor Framework: parallel arithmetic on multidimensional arrays
Other
194 stars 53 forks source link

ModuleNotFoundError: No module named 'ctf.core' #135

Closed ghost closed 2 years ago

ghost commented 2 years ago

Thank you so much for all your help. I upgraded my system to ubuntu 20.04 in windows and reinstalled ctf. I installed Intel(R) MPI Library for Linux* OS, Version 2021.4 Build 20210831 (id: 758087adf).

Now make test leads to

Testing completed, 53/53 tests passed

make python_test gets to

echo "Cyclops Python tests completed."
Cyclops Python tests completed.

But if I do a import ctf in python, it leads to

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/ctf/__init__.py", line 1, in <module>
    from ctf.core import *
ModuleNotFoundError: No module named 'ctf.core'

sudo make python_install does not help.

which is confusing. What would be the reason make python_test ok but import ctf does not work :(

In the information of make python_test, there is

LD_LIBRARY_PATH="/home/user/intel/oneapi/intelpython/latest/lib/libfabric:/home/user/intel/oneapi/mkl/2021.4.0/lib/intel64/:/home/user/ctf-master/lib_shared:/home/user/ctf-master/lib_python:/opt/OpenBLAS/lib" PYTHONPATH=":/home/user/ctf-master/lib_python" python ./test/python/test_ufunc.py
./test/python/test_ufunc.py:67: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  a1 = ctf.astensor(a0)

I can run as LD_LIBRARY_PATH="/home/user/intel/oneapi/intelpython/latest/lib/libfabric:/home/user/intel/oneapi/mkl/2021.4.0/lib/intel64/:/home/user/ctf-master/lib_shared:/home/user/ctf-master/lib_python:/opt/OpenBLAS/lib" PYTHONPATH=":/home/user/ctf-master/lib_python" python ./test/python/test_ufunc.py it would work, but that's weird, and should be simpler

ghost commented 2 years ago

It works after adding

export LD_LIBRARY_PATH=/home/user/intel/oneapi/intelpython/latest/lib/libfabric:/home/user/intel/oneapi/mkl/2021.4.0/lib/intel64/:/home/user/ctf-master/lib_shared:/home/user/ctf-master/lib_python:/opt/OpenBLAS/lib

export PYTHONPATH=":/home/user/ctf-master/lib_python"

in .bashrc