There are 2 tips for windows10 user who are facing below errors after installing ROOT through "msi installer".
>>> import ROOT
Error code 1
Traceback (most recent call last): File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'ROOT'
>>> import ROOT
Error code 2
ImportError: Failed to import libcppyy3_8. Please check that ROOT has been built for Python 3.8
Solution 1(for Error code 1): set environments for executing "thisroot.bat" in %ROOTSYS%\bin\ folder.
For example, go to C:\root_v6.26.00\bin\ and, execute thisroot.bat. It will set %ROOTSYS%, %PATH%, %PYTHONPATH% etc.. You can findout this batch file(thisroot.bat) in C:\"where you installed"\bin.
For example,
> C:\root_v6.26.00\bin\thisroot.bat ↵
** Caution: this solution performs in Command Prompt(CMD) environment.
More details ...
%ROOTSYS% should be like "C:\root_v6.26.00" where you installed.
%PYTHONPATH% should be like "C:\root_v6.26.00\bin".
Solution 2(for Error code 2): install python verseion 3.8 32 bit(for me, Python 3.8.8rc1 which is for 32bit) .
"32bit" is most important factor to use PyROOT. ROOT is offering python libraries but pre-compiled version using 32 bit compiler(I guess).
You can findout libcppyy3_8.pyd(essential DLL for PyROOT) in %ROOTSYS%\bin. But it will work only when you install "python version 3.8 for 32bit". This does not mean you have to prepare 32bit windows. My windows10 is 64bit.
** Caution: In case the name of the DLL in %ROOTSYS%\bin like libcppyy3_7.pyd, follow the version of the name on it.
'리빙포인트' 카테고리의 다른 글
[라즈베리파이] numpy 관련 Pandas import error (0) | 2024.02.17 |
---|---|
라즈베리파이 + OMV 6, desktop environment error (1) | 2024.02.15 |
[python] SyntaxError: Non-UTF-8 code starting with '\xbe' (0) | 2022.03.21 |
[주식투자] 한경 컨센서스에 없는 증권사리포트 읽기 (0) | 2022.02.23 |
[티스토리] 코드블럭 꾸미기 (highlight.js) (0) | 2022.02.06 |
댓글