Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import taichi encounter taichi_core error #4270

Closed
Peterritche opened this issue Feb 14, 2022 · 30 comments
Closed

Import taichi encounter taichi_core error #4270

Peterritche opened this issue Feb 14, 2022 · 30 comments
Labels
question Question on using Taichi

Comments

@Peterritche
Copy link

build taichi from source code,and import taichi will show below error
export PYTHONPATH=$TAICHI_REPO_DIR/python:$PYTHONPATH is set in my ubuntu21.10 .bashrc.

import taichi
Share object taichi_core import failed, check this page for possible solutions:
https://docs.taichi.graphics/lang/articles/misc/install
Traceback (most recent call last):
File "", line 1, in
File "/home/linaro/ssd/git/taichi/python/taichi/init.py", line 3, in
from taichi._funcs import *
File "/home/linaro/ssd/git/taichi/python/taichi/_funcs.py", line 3, in
from taichi.lang import impl, matrix, ops
File "/home/linaro/ssd/git/taichi/python/taichi/lang/init.py", line 3, in
from taichi._lib import core as _ti_core
File "/home/linaro/ssd/git/taichi/python/taichi/_lib/init.py", line 1, in
from taichi._lib.utils import ti_core as core
File "/home/linaro/ssd/git/taichi/python/taichi/_lib/utils.py", line 103, in
ti_core = import_ti_core()
File "/home/linaro/ssd/git/taichi/python/taichi/_lib/utils.py", line 54, in import_ti_core
raise e from None
File "/home/linaro/ssd/git/taichi/python/taichi/_lib/utils.py", line 43, in import_ti_core
from taichi._lib.core import
ImportError: cannot import name 'taichi_core' from 'taichi._lib.core' (/home/linaro/ssd/git/taichi/python/taichi/_lib/core/init.py)

@Peterritche Peterritche added the question Question on using Taichi label Feb 14, 2022
@bobcao3
Copy link
Collaborator

bobcao3 commented Feb 14, 2022

Hello! Does using the taichi from pip work? (Does it only happen when you build it from source?)

@k-ye
Copy link
Member

k-ye commented Feb 14, 2022

In addition, could you share your build error log as well? THx

@Peterritche
Copy link
Author

work fine(using the taichi from pip), tried it just now.

@Peterritche
Copy link
Author

Another attention: under my ubuntu21.10, Build llvm/TVM both ok.
but taichi, I already try my best to fix it. still failed

@Peterritche
Copy link
Author

In addition, could you share your build error log as well? THx
No build error.
only import taichi will show above errors.

@Peterritche
Copy link
Author

Hello! Does using the taichi from pip work? (Does it only happen when you build it from source?)

Yes, pip install will be work find.

@k-ye
Copy link
Member

k-ye commented Feb 15, 2022

So after your build, there is no libtaichi_core.so under the build directory?

@Peterritche
Copy link
Author

build everything is ok, below is about some file after building:
so, libtaichi_core.so under below folder.

(taichi) linaro@linaro:~/ssd/git/taichi/build$ ls
CMakeCache.txt cmake_install.cmake libSPIRV-Tools-shared.so Makefile SPIRV-ToolsConfig.cmake SPIRV-Tools-linkConfig.cmake SPIRV-Tools-optConfig.cmake taichi_cpp_examples
CMakeFiles external libtaichi_core.so runtime_x64.bc SPIRV-Tools-diffConfig.cmake SPIRV-Tools-lintConfig.cmake SPIRV-Tools-reduceConfig.cmake

@bobcao3
Copy link
Collaborator

bobcao3 commented Feb 15, 2022

Would you mind sending your CMakeCache.txt ?

@bobcao3
Copy link
Collaborator

bobcao3 commented Feb 15, 2022

Remove all the sensitive information from it that is

@Peterritche
Copy link
Author

Peterritche commented Feb 15, 2022 via email

@bobcao3
Copy link
Collaborator

bobcao3 commented Feb 15, 2022

Hello, it seems the CMakeCache file does not contain variables that should be there. Did you use the python setup.py develop command to build?

@Peterritche
Copy link
Author

Peterritche commented Feb 15, 2022 via email

@bobcao3
Copy link
Collaborator

bobcao3 commented Feb 15, 2022

You can follow the steps in https://docs.taichi.graphics/lang/articles/contribution/dev_install !

@Peterritche
Copy link
Author

Peterritche commented Feb 15, 2022 via email

@Peterritche
Copy link
Author

Peterritche commented Feb 15, 2022 via email

@bobcao3
Copy link
Collaborator

bobcao3 commented Feb 15, 2022

Hmmmm, do you have access to clang-10?

@Peterritche
Copy link
Author

Peterritche commented Feb 15, 2022 via email

@Peterritche
Copy link
Author

Peterritche commented Feb 15, 2022 via email

@ailzhang
Copy link
Contributor

@Peterritche Hey I'm curious why do you want to build taichi from source instead of pip installing taichi or taichi-nightly? Those are definitely more convenient.

Btw if you really need to build from source, try the following

unset PYTHONPATH
which python # make sure you have python in your path
which llvm-as 
llvm-as --version
clang++ --version

and then follow the steps in https://docs.taichi.graphics/lang/articles/contribution/dev_install.

@Peterritche
Copy link
Author

Peterritche commented Feb 15, 2022 via email

@bobcao3
Copy link
Collaborator

bobcao3 commented Feb 18, 2022

Hello, it seems like this issue is related to the installed LLVM environment, maybe the path has been polluted. If you still have difficulties after another attempt, please feel free to reopen this issue.

@bobcao3 bobcao3 closed this as completed Feb 18, 2022
@Peterritche
Copy link
Author

Peterritche commented Feb 19, 2022 via email

@Peterritche
Copy link
Author

Peterritche commented Feb 19, 2022 via email

@Peterritche
Copy link
Author

Peterritche commented Feb 19, 2022 via email

@Peterritche
Copy link
Author

Peterritche commented Feb 19, 2022 via email

@k-ye
Copy link
Member

k-ye commented Feb 19, 2022

I didn't follow through your error messages, but seems like your LLVM-10 build itself didn't succeed? #4270 (comment)

@Peterritche
Copy link
Author

Peterritche commented Feb 19, 2022 via email

@Peterritche
Copy link
Author

Peterritche commented Feb 19, 2022 via email

@Peterritche
Copy link
Author

Peterritche commented Feb 23, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question on using Taichi
Projects
None yet
Development

No branches or pull requests

4 participants