FABLE-3DXRD/xrd_simulator

pybind11 not resolved automatically

vamatya opened this issue ยท 3 comments

Platform: x86_64
OS: UBUNTU 20.04
Python Version: 10 or 9
Installation command: python setup.py install (from source)

Error:
Searching for pygalmesh
Reading https://pypi.org/simple/pygalmesh/
Downloading https://files.pythonhosted.org/packages/a5/94/4a817068bfc4ca8e0d91856e2d22186381800139ae8685b73e3cf94c4689/pygalmesh-0.10.7.tar.gz#sha256=2db842cfd43aed9beb2c3a2dae6276206d16587131b6f068f6c5ba049b6af2f9
Best match: pygalmesh 0.10.7
Processing pygalmesh-0.10.7.tar.gz
Writing /tmp/easy_install-47vxhrdh/pygalmesh-0.10.7/setup.cfg
Running pygalmesh-0.10.7/setup.py -q bdist_egg --dist-dir /tmp/easy_install-47vxhrdh/pygalmesh-0.10.7/egg-dist-tmp-eqi8o1hb
Traceback (most recent call last):
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 158, in save_modules
yield saved
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 200, in setup_context
yield
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 261, in run_setup
_execfile(setup_script, ns)
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 48, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-47vxhrdh/pygalmesh-0.10.7/setup.py", line 3, in
with open("README.rst", "r", encoding="utf-8") as fh:
ModuleNotFoundError: No module named 'pybind11'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/WORKSPACE/XRD/xrd_simulator/setup.py", line 7, in
setuptools.setup(
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/init.py", line 108, in setup
return distutils.core.setup(**attrs)
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 184, in setup
return run_commands(dist)
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
dist.run_commands()
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 970, in run_commands
self.run_command(cmd)
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/dist.py", line 945, in run_command
super().run_command(command)
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 989, in run_command
cmd_obj.run()
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/command/install.py", line 92, in run
self.do_egg_install()
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/command/install.py", line 153, in do_egg_install
cmd.run(show_deprecation=False)
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 437, in run
self.easy_install(spec, not self.no_deps)
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 686, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 736, in install_item
self.process_distribution(spec, dist, deps)
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 785, in process_distribution
distros = WorkingSet([]).resolve(
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/pkg_resources/init.py", line 896, in resolve
dist = self._resolve_dist(
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/pkg_resources/init.py", line 932, in _resolve_dist
dist = best[req.key] = env.best_match(
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/pkg_resources/init.py", line 1262, in best_match
return self.obtain(req, installer)
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/pkg_resources/init.py", line 1298, in obtain
return installer(requirement) if installer else None
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 709, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 734, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 931, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 1203, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 1189, in run_setup
run_setup(setup_script, args)
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 251, in run_setup
with setup_context(setup_dir):
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 192, in setup_context
with save_modules():
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 171, in save_modules
saved_exc.resume()
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 145, in resume
raise exc.with_traceback(self._tb)
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 158, in save_modules
yield saved
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 200, in setup_context
yield
File "/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 261, in run_setup
_execfile(setup_script, ns)
File "
/miniconda3/envs/xrdsim_src_py3.10/lib/python3.10/site-packages/setuptools/sandbox.py", line 48, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-47vxhrdh/pygalmesh-0.10.7/setup.py", line 3, in
with open("README.rst", "r", encoding="utf-8") as fh:
ModuleNotFoundError: No module named 'pybind11'

Explicit pip install pybind11 before installation from source works.

Thanks for posting issues on our lib! ๐Ÿš€ This is great for our development ๐Ÿ˜Ž

To the point, this stack-trace does not make sense to me. Why would a

with open("README.rst", "r", encoding="utf-8") as fh:

require bindings? Is there no additional/expanded stack-trace?

Cheers ๐Ÿ™‚
Axel

Sorry for the sparsity of the error log. I've updated the error log above with more text. Hope it is more helpful. :)

Regards
Vinay

Thanks ๐Ÿ™‚

This looks like a misleading stacktrace.

In fact I believe this is an error of pygalmesh not xrd_simulator. In the pygalmesh setup.py file there is on line 3 a pybind11 import.. So that is not going to work out of the box with pip ..... ๐Ÿ˜ž

As stated in the xrd_simulator docs one needs to resolve pygalmesh installation before running the setup.py install. In general pygalmesh is dependent on cgal and will require os-specific binaries. Again, using conda to install pygalmesh will in general work cross platform.

Good to know that explicit pip install pybind11 before installation from source works. But I feel hesitant to add pybind11 to our setup.py requirements. This should be resolved upstream in pygalmesh imo.

Cheers
Axel