maj-personal-repos / dji-sdk-python

DJI SDK python interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setup.py AttributeError: module 'pybind11' has no attribute 'get_include'

rdepew opened this issue · comments

Cloned the repo on 15 Oct 2020. The Github webpage lists the most recent changes as 3 years ago; however, gitk shows that development continues almost daily. That's a good sign.

I followed the instructions in the README for installing dependencies; however, I installed the Python3 versions of the packages instead. Python2 is dead; long live Python3.

Here's where I started having problems.

Trying to run the command python3 setup.py build_ext -i resulted in the expected issues with the Python2 print statement. I edited the print statements in djisdk-sample.py and setup.py and tried it again.

Trying to run the command python3 setup.py build_ext -i a second time got this far:

x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c /tmp/tmp3xlafavu.cpp -o tmp/tmp3xlafavu.o -fvisibility=hidden
building 'djisdkpy' extension
Traceback (most recent call last):
  File "setup.py", line 123, in <module>
    setup(
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 87, in run
    _build_ext.run(self)
  File "/usr/lib/python3.8/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "setup.py", line 121, in build_extensions
    build_ext.build_extensions(self)
  File "/usr/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "/usr/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 208, in build_extension
    _build_ext.build_extension(self, ext)
  File "/usr/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension
    objects = self.compiler.compile(sources,
  File "/usr/lib/python3.8/distutils/ccompiler.py", line 565, in compile
    self._setup_compile(output_dir, macros, include_dirs, sources,
  File "/usr/lib/python3.8/distutils/ccompiler.py", line 341, in _setup_compile
    pp_opts = gen_preprocess_options(macros, incdirs)
  File "/usr/lib/python3.8/distutils/ccompiler.py", line 1076, in gen_preprocess_options
    pp_opts.append("-I%s" % dir)
  File "setup.py", line 23, in __str__
    return pybind11.get_include(self.user)
AttributeError: module 'pybind11' has no attribute 'get_include'

I grepped the pybind11 directory and found get_include in the file pybind11\pybind11\__init__.py . I don't know why setup.py can't find it.

According to gitk, I'm using the master branch. I tried to checkout branch v2.5, and it wouldn't let me:

$ git checkout v2.5
error: pathspec 'v2.5' did not match any file(s) known to git.
$ git fetch
$ git checkout v2.5
error: pathspec 'v2.5' did not match any file(s) known to git.
$ git checkout stable
error: pathspec 'stable' did not match any file(s) known to git.

I'm doing something wrong, but I don't know what it is. Does it all stem from trying to use Python3 instead of Python2?