Hi,
the original error message:
[ 61%] Generating code_info.pyx Fatal Python error: Py_Initialize: can't initialize sys standard streams Traceback (most recent call last): File "/home/shawn/sourcecode/espresso/src/python/espressomd/io/__init__.py", line 17, in <module> File "/home/shawn/sourcecode/espresso/src/python/espressomd/io/writer/__init__.py", line 17, in <module> ValueError: attempted relative import beyond top-level package /bin/sh: line 1: 15371 Aborted (core dumped) /home/shawn/soft/python3/bin/python3 gen_code_info.py /home/shawn/sourcecode/espresso/src/features.def /home/shawn/sourcecode/espresso/build4/src/python/espressomd/code_info.pyx make[2]: *** [src/python/espressomd/code_info.pyx] Error 134 make[1]: *** [src/python/espressomd/CMakeFiles/code_info.dir/all] Error 2 make: *** [all] Error 2
looks to me as the interpreter tries to import espressomd modules although there is no package information due to the fact that at that point a python script (gen_code_info.py) is called.
I don’t see why this should be related to any arch. More probably would be an issue with the build system generator (cmake).
Best,
Kai
Kai Szuttor Institute for Computational Physics Universität Stuttgart Allmandring 3 Room 1.084 70569 Stuttgart, Germany Phone: +49 711 685-67707
Hi Shawn, I can't reproduce the error message with python3.6.8 on 64bit CentOS 7 in docker. Only my 32bit Debian can reproduce the error, unfortunately espresso is not fully compatible with this specific 32bit architecture so I cannot look for a solution on it. Let's do the following experiment: you'll rename the src/python/espressomd/io folder and try compiling again. To this end, please use the attached patch file and bash script (store both of them in /home/shawn/sourcecode/espresso). Run the bash script with "bash io-build.sh" and let me know if you still have an error message. Note that the source folder won't be cleaned up in case of error. Best, JN On 2019-07-17 20:28, Shawn wrote: Hi Jean-Noël, I really appreciate your help, and I also look forward to your investigation on this issue.By the way, currently my python version on 64-bit centos 7 is 3.6.5 but it seems like I have the same problem with python 3.7.2. I hope these information is helpful for your investigation. Thanks very much. Best, Shawn Jean-Noël Grad <address@hidden> 于2019年7月17日周三 下午1:09写道:
Hi Kai, To follow-up on our offline disccussion about Shawn's issue, I could only reproduce it when starting a python3.5.3 interpreter inside the /src/python/espressomd folder. Attached is a minimum non-working example reproducing the espressomd folder structure (bash command to get the error message: tar xfz MNWE.tar.gz; cd espressomd; python3). A few observations: - reproducible with python3.5.3 on my 32bit Debian laptop but not with 64bit Debian in docker - not reproducible with python3.5.2 and python3.6.8 on 64bit Ubuntu - not reproducible with python2.7.13 on my 32bit Debian laptop - Shawn has python3.6.x - commenting out the import statement in espressomd/io/writer/__init__.py creates a different error message that suggests the real culprit is the "io" espressomd submodule overshadowing the standard "io" module Best regards, JN On 7/17/19 7:44 PM, Jean-Noël Grad wrote:
Hi Shawn, I am unable to reproduce the error message using your CMake
command.
However, I am able to reproduce it by duplicating the structure of
/src/python/espressomd in a different folder and simply starting a
python3 interpreter inside of it: Fatal Python error: Py_Initialize: can't initialize sys standard
streams
Traceback (most recent call last): File
"/home/grad/Documents/espresso-structure/src/python/espressomd/io/__init__.py",
line 17, in <module> File
"/home/grad/Documents/espresso-structure/src/python/espressomd/io/writer/__init__.py",
line 1, in <module> ValueError: attempted relative import beyond top-level package Aborted This error shouldn't happen when using CMake because the target "code_info.pyx" is generated via a python script located in the top-level folder that is executed by a python interpreter running
in the
/build folder. I'm currently investigating the issue with a coworker. Best regards, JN On 7/15/19 7:48 PM, Shawn wrote:
Hi Jean-Noël, Thanks very much for helping me. Attached please find the script
of my
build and the cmake output. I just used the default myconfig.hpp
file.
Regards, Shawn Jean-Noël Grad <address@hidden <mailto:address@hidden>> 于2019年7月15日周一
下午12:26写道:
Hi Shawn, The 4.0.2 release is tested for both python versions. I'm not
familiar with this error message. It could be due to your Cython
version,
or to an unclean build directory. To reproduce your issue, we will
need the
cmake command you used for this build and its output in the
terminal.
It's only 80 lines long and contains valuable information
such as the
Cython version and espresso dependencies. If you're using a
custom
myconfig.hpp file, please also post its content. Best regards, JN On 7/15/19 6:58 PM, Shawn wrote:
Hi everyone, I am trying install espresso 4.0.2 with python 3. The
cmake
command
could be executed successfully, but when I tried to
compile the
source
code, I got errors below: [ 61%] Generating code_info.pyx Fatal Python error: Py_Initialize: can't initialize sys
standard
streams
Traceback (most recent call last): File
"/home/shawn/sourcecode/espresso/src/python/espressomd/io/__init__.py",
line 17, in <module> File
"/home/shawn/sourcecode/espresso/src/python/espressomd/io/writer/__init__.py",
line 17, in <module> ValueError: attempted relative import beyond top-level
package
/bin/sh: line 1: 15371 Aborted (core
dumped)
/home/shawn/soft/python3/bin/python3 gen_code_info.py /home/shawn/sourcecode/espresso/src/features.def
/home/shawn/sourcecode/espresso/build4/src/python/espressomd/code_info.pyx
make[2]: *** [src/python/espressomd/code_info.pyx] Error
134
make[1]: ***
[src/python/espressomd/CMakeFiles/code_info.dir/all]
Error 2
make: *** [all] Error 2 It's so confusing, because I can successfully install
espresso
with
python 2 on the same computer and I can also install
espresso with
python 3 on another computer. Does anyone know how to fix this? Thank you very much. Regards, Shawn
<io.patch><io-build.sh>
|