MiroK / fenics_ii

MIT License
15 stars 8 forks source link

fail to run the demo/daq_3d1d.py with FileExistsError: [Errno 17] #7

Open luogyong opened 9 months ago

luogyong commented 9 months ago

Dear MiroK,

I configured a Conda environment on Ubuntu 22.04 (WSL2) and attempted to execute your demo/daq_3d1d.py, but it was unsuccessful. Could you provide any advice on resolving this issue? I would greatly appreciate it. The Python version I'm using is 3.12.1. Here is the error message:

/home/gyluo/cbc.block/src/block/splitting.py:14: SyntaxWarning: invalid escape sequence '\s' """Split the form. Missing HsMG for fract norm computing /home/gyluo/anaconda3/envs/fenicsproject/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!

    ********************************************************************************
    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
    ********************************************************************************

!! self.initialize_options() Traceback (most recent call last): File "/home/gyluo/fenics_ii/demo/daq_3d1d.py", line 9, in from xii import File "/home/gyluo/.local/lib/python3.12/site-packages/xii/init.py", line 2, in from xii.assembler import File "/home/gyluo/.local/lib/python3.12/site-packages/xii/assembler/init.py", line 4, in from . restriction_form import Restriction File "/home/gyluo/.local/lib/python3.12/site-packages/xii/assembler/restriction_form.py", line 3, in from xii.meshing.subdomain_mesh import SubDomainMesh File "/home/gyluo/.local/lib/python3.12/site-packages/xii/meshing/init.py", line 2, in from .embedded_mesh import EmbeddedMesh, OuterNormal, InnerNormal, TangentCurve, Skeleton File "/home/gyluo/.local/lib/python3.12/site-packages/xii/meshing/embedded_mesh.py", line 5, in from .make_mesh_cpp import make_mesh File "/home/gyluo/.local/lib/python3.12/site-packages/xii/meshing/make_mesh_cpp.py", line 79, in module = compile_cpp(code) ^^^^^^^^^^^^^^^^^ File "/home/gyluo/anaconda3/envs/fenicsproject/lib/python3.12/site-packages/dolfin/jit/pybind11jit.py", line 58, in compile_cpp_code params['build']['include_dirs'] = dolfin_pc["include_dirs"] + extra_include_dirs + get_pybind_include() + [sysconfig.get_config_var("INCLUDEDIR") + "/" + pyversion] ^^^^^^^^^^^^^^^^^^^^ File "/home/gyluo/anaconda3/envs/fenicsproject/lib/python3.12/site-packages/dolfin/jit/init.py", line 16, in get_pybind_include return [pybind11.get_include(True), pybind11.get_include()] ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/gyluo/anaconda3/envs/fenicsproject/lib/python3.12/site-packages/pybind11/init.py", line 26, in get_include dist_cobj.finalize_options() File "/home/gyluo/anaconda3/envs/fenicsproject/lib/python3.12/site-packages/setuptools/command/install.py", line 55, in finalize_options orig.install.finalize_options(self) File "/home/gyluo/anaconda3/envs/fenicsproject/lib/python3.12/site-packages/setuptools/_distutils/command/install.py", line 462, in finalize_options self.create_home_path() File "/home/gyluo/anaconda3/envs/fenicsproject/lib/python3.12/site-packages/setuptools/_distutils/command/install.py", line 689, in create_home_path os.makedirs(path, 0o700) File "", line 225, in makedirs FileExistsError: [Errno 17] File exists: '/home/gyluo/anaconda3/envs/fenicsproject/bin/python3.12'

MiroK commented 9 months ago

Hi could you pay here your conda environment file. I can't reproduce your error with my setup. Also, are you able to run fenics?

luogyong commented 9 months ago

Dear Dr. Miroslav

Thank you for your prompt response.

yes. I can run the fenics example sush as poisson.py (people.sc.fsu.edu/~jburkardt/fenics_src/poisson/poisson.py) without any problem. My conda environment file is attached below.

name: fenicsproject channels:

@.***

From: Miroslav Kuchta Date: 2024-02-03 03:41 To: MiroK/fenics_ii CC: luogyong; Author Subject: Re: [MiroK/fenics_ii] fail to run the demo/daq_3d1d.py with FileExistsError: [Errno 17] (Issue #7) Hi could you pay here your conda environment file. I can't reproduce your error with my setup. Also, are you able to run fenics? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

luogyong commented 9 months ago

At last, I discovered that the issue stems from pybind11. Specifically, the include folder is missing in the pybind11 directory. To resolve this, I reinstalled it using the script below: 1) git clone https://github.com/pybind/pybind11.git 2) cd pybind11 3) pip install . 4) export PYBIND11_DIR=/pybind11/

MiroK commented 9 months ago

Great and thanks for debugging!