nullp0tr / bluew

Bluew is a simple and easy to use bluetooth API for python
MIT License
15 stars 2 forks source link

import bluew fails #2

Closed ukBaz closed 6 years ago

ukBaz commented 6 years ago

Thanks for updating the requirements.txt file.

I've had a go at installing BlueW into a virtual environment and I get an error when I try import bluew

Any ideas what I did wrong?

pi@RPi3:~ $ python3 -m venv /home/pi/simple_python/
pi@RPi3:~ $ source simple_python/bin/activate
(simple_python) pi@RPi3:~ $ pip install git+https://github.com/nullp0tr/bluew.git
Collecting git+https://github.com/nullp0tr/bluew.git
  Cloning https://github.com/nullp0tr/bluew.git to /tmp/pip-2j1m_cfk-build
Installing collected packages: bluew
  Running setup.py install for bluew ... done
Successfully installed bluew-0.3.1
(simple_python) pi@RPi3:~ $ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bluew
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/simple_python/lib/python3.5/site-packages/bluew/__init__.py", line 14, in <module>
    from .api import connect, disconnect, remove
  File "/home/pi/simple_python/lib/python3.5/site-packages/bluew/api.py", line 23, in <module>
    from .connections import Connection
  File "/home/pi/simple_python/lib/python3.5/site-packages/bluew/connections.py", line 14, in <module>
    import bluew.plugables
  File "/home/pi/simple_python/lib/python3.5/site-packages/bluew/plugables.py", line 13, in <module>
    from bluew.dbusted import DBusted
ImportError: No module named 'bluew.dbusted'
nullp0tr commented 6 years ago

Hey again! You definitely didn't do anything wrong. I got used to using pip install with -e flag to just link to my working directory so I can test changes quickly, and didn't include the submodule dbusted in setup.py, so pip was not installing that one. I fixed the problem in https://github.com/nullp0tr/bluew/commit/08e6ce11be2524f2f9de4b937531e47f812894ce let me know if it works!

ukBaz commented 6 years ago

Hi!

Sorry to say I am still having issues:

pi@RPi3:~ $ sudo apt update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Reading package lists... Done
Building dependency tree        
Reading state information... Done
All packages are up to date.
pi@RPi3:~ $ python3 -m venv /home/pi/bluew_test
pi@RPi3:~ $ source bluew_test/bin/activate
(bluew_test) pi@RPi3:~ $ pip3 install git+https://github.com/nullp0tr/bluew.git
Collecting git+https://github.com/nullp0tr/bluew.git
  Cloning https://github.com/nullp0tr/bluew.git to /tmp/pip-swj12ust-build
Collecting dbus-python (from bluew==0.3.1)
  Using cached dbus-python-1.2.4.tar.gz
Collecting vext.gi (from bluew==0.3.1)
  Using cached vext.gi-0.6.8.tar.gz
Collecting vext>=0.6.8 (from vext.gi->bluew==0.3.1)
  Using cached https://www.piwheels.hostedpi.com/simple/vext/vext-0.7.0-py3-none-any.whl
Collecting ruamel.yaml>=0.11.10 (from vext>=0.6.8->vext.gi->bluew==0.3.1)
  Using cached https://www.piwheels.hostedpi.com/simple/ruamel-yaml/ruamel.yaml-0.15.35-cp35-cp35m-linux_armv7l.whl
Building wheels for collected packages: dbus-python, vext.gi
  Running setup.py bdist_wheel for dbus-python ... error
  Complete output from command /home/pi/bluew_test/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b_o6r6y9/dbus-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpfwtqxxacpip-wheel- --python-tag cp35:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  error: invalid command 'bdist_wheel'

  ----------------------------------------
  Failed building wheel for dbus-python
  Running setup.py clean for dbus-python
  Running setup.py bdist_wheel for vext.gi ... error
  Complete output from command /home/pi/bluew_test/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b_o6r6y9/vext.gi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmptdg_qasgpip-wheel- --python-tag cp35:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help

  error: invalid command 'bdist_wheel'

  ----------------------------------------
  Failed building wheel for vext.gi
  Running setup.py clean for vext.gi
Failed to build dbus-python vext.gi
Installing collected packages: dbus-python, ruamel.yaml, vext, vext.gi, bluew
  Running setup.py install for dbus-python ... error
    Complete output from command /home/pi/bluew_test/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b_o6r6y9/dbus-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-fh04h9cj-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/bluew_test/include/site/python3.5/dbus-python:
    running install
    running build
    creating /tmp/pip-build-b_o6r6y9/dbus-python/build
    creating /tmp/pip-build-b_o6r6y9/dbus-python/build/temp.linux-armv7l-3.5
    checking whether make supports nested variables... yes
    checking whether to enable maintainer-specific portions of Makefiles... no
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... no
    checking for mawk... mawk
    checking whether make sets $(MAKE)... yes
    checking whether UID '1000' is supported by ustar format... yes
    checking whether GID '1000' is supported by ustar format... yes
    checking how to create a ustar tar archive... gnutar
    checking build system type... armv7l-unknown-linux-gnueabihf
    checking host system type... armv7l-unknown-linux-gnueabihf
    checking for native Windows host... no
    checking how to print strings... printf
    checking for style of include used by make... GNU
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking whether gcc understands -c and -o together... yes
    checking dependency style of gcc... gcc3
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for fgrep... /bin/grep -F
    checking for ld used by gcc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 1572864
    checking how to convert armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format... func_convert_file_noop
    checking how to convert armv7l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
    checking for /usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... no
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver @FILE support... @
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for sysroot... no
    checking for a working dd... /bin/dd
    checking how to truncate binary pipes... /bin/dd bs=4096 count=1
    checking for mt... mt
    checking if mt is a manifest tool... no
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -fPIC -DPIC
    checking if gcc PIC flag -fPIC -DPIC works... yes
    checking if gcc static flag -static works... yes
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    checking for inline... inline
    checking whether /home/pi/bluew_test/bin/python3 version is >= 2.6... yes
    checking for /home/pi/bluew_test/bin/python3 version... 3.5
    checking for /home/pi/bluew_test/bin/python3 platform... linux
    checking for /home/pi/bluew_test/bin/python3 script directory... ${prefix}/lib/python3.5/site-packages
    checking for /home/pi/bluew_test/bin/python3 extension module directory... ${exec_prefix}/lib/python3.5/site-packages
    checking for python3.5-config... /usr/bin/python3.5-config
    checking for Python headers using /usr/bin/python3.5-config --includes... -I/usr/include/python3.5m -I/usr/include/python3.5m
    checking whether those headers are sufficient... yes
    checking for Python library linker flags using /usr/bin/python3.5-config... -L/usr/lib/python3.5/config-3.5m-arm-linux-gnueabihf -L/usr/lib -lpython3.5m -lpthread -ldl  -lutil -lm  -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
    checking for git... /usr/bin/git
    checking whether you want to build HTML docs... if possible
    checking whether you want to build API docs... if possible
    checking python3 module: docutils... no
    checking for dbus-run-session... /usr/bin/dbus-run-session
    checking whether  understands --generator... no
    checking whether  understands --date... no
    checking whether  understands --time... no
    checking whether  understands --exit-status=2... no
    checking whether  understands --no-raw... no
    checking whether  understands --no-file-insertion... no
    checking whether  understands --cloak-email-addresses... no
    checking whether  understands --input-encoding=UTF-8... no
    checking for pkg-config... /usr/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for DBUS... no
    configure: error: Package requirements (dbus-1 >= 1.6) were not met:

    No package 'dbus-1' found

    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.

    Alternatively, you may set the environment variables DBUS_CFLAGS
    and DBUS_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-b_o6r6y9/dbus-python/setup.py", line 106, in <module>
        'build_ext': BuildExt,
      File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/pi/bluew_test/lib/python3.5/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run
        self.run_command('build')
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-b_o6r6y9/dbus-python/setup.py", line 62, in run
        cwd=builddir)
      File "/usr/lib/python3.5/subprocess.py", line 271, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/tmp/pip-build-b_o6r6y9/dbus-python/configure', '--disable-maintainer-mode', 'PYTHON=/home/pi/bluew_test/bin/python3', '--prefix=/tmp/pip-build-b_o6r6y9/dbus-python/build/temp.linux-armv7l-3.5/prefix']' returned non-zero exit status 1

    ----------------------------------------
Command "/home/pi/bluew_test/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b_o6r6y9/dbus-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-fh04h9cj-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/bluew_test/include/site/python3.5/dbus-python" failed with error code 1 in /tmp/pip-build-b_o6r6y9/dbus-python/

A search has turned up that it might be because I needed to install the wheel package so:

(bluew_test) pi@RPi3:~ $ pip install wheel
Collecting wheel
  Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
    100% |████████████████████████████████| 51kB 444kB/s 
Installing collected packages: wheel
Successfully installed wheel-0.30.0

Then when I try again:

(bluew_test) pi@RPi3:~ $ pip3 install git+https://github.com/nullp0tr/bluew.git
Collecting git+https://github.com/nullp0tr/bluew.git
  Cloning https://github.com/nullp0tr/bluew.git to /tmp/pip-1jnbix2c-build
Collecting dbus-python (from bluew==0.3.1)
  Using cached dbus-python-1.2.4.tar.gz
Collecting vext.gi (from bluew==0.3.1)
  Using cached vext.gi-0.6.8.tar.gz
Collecting vext>=0.6.8 (from vext.gi->bluew==0.3.1)
  Using cached https://www.piwheels.hostedpi.com/simple/vext/vext-0.7.0-py3-none-any.whl
Collecting ruamel.yaml>=0.11.10 (from vext>=0.6.8->vext.gi->bluew==0.3.1)
  Using cached https://www.piwheels.hostedpi.com/simple/ruamel-yaml/ruamel.yaml-0.15.35-cp35-cp35m-linux_armv7l.whl
Building wheels for collected packages: dbus-python, vext.gi
  Running setup.py bdist_wheel for dbus-python ... error
  Complete output from command /home/pi/bluew_test/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-bbltm1fj/dbus-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp8h3jvs_apip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  creating /tmp/pip-build-bbltm1fj/dbus-python/build
  creating /tmp/pip-build-bbltm1fj/dbus-python/build/temp.linux-armv7l-3.5
  checking whether make supports nested variables... yes
  checking whether to enable maintainer-specific portions of Makefiles... no
  checking for a BSD-compatible install... /usr/bin/install -c
  checking whether build environment is sane... yes
  checking for a thread-safe mkdir -p... /bin/mkdir -p
  checking for gawk... no
  checking for mawk... mawk
  checking whether make sets $(MAKE)... yes
  checking whether UID '1000' is supported by ustar format... yes
  checking whether GID '1000' is supported by ustar format... yes
  checking how to create a ustar tar archive... gnutar
  checking build system type... armv7l-unknown-linux-gnueabihf
  checking host system type... armv7l-unknown-linux-gnueabihf
  checking for native Windows host... no
  checking how to print strings... printf
  checking for style of include used by make... GNU
  checking for gcc... gcc
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc accepts -g... yes
  checking for gcc option to accept ISO C89... none needed
  checking whether gcc understands -c and -o together... yes
  checking dependency style of gcc... gcc3
  checking for a sed that does not truncate output... /bin/sed
  checking for grep that handles long lines and -e... /bin/grep
  checking for egrep... /bin/grep -E
  checking for fgrep... /bin/grep -F
  checking for ld used by gcc... /usr/bin/ld
  checking if the linker (/usr/bin/ld) is GNU ld... yes
  checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
  checking the name lister (/usr/bin/nm -B) interface... BSD nm
  checking whether ln -s works... yes
  checking the maximum length of command line arguments... 1572864
  checking how to convert armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format... func_convert_file_noop
  checking how to convert armv7l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
  checking for /usr/bin/ld option to reload object files... -r
  checking for objdump... objdump
  checking how to recognize dependent libraries... pass_all
  checking for dlltool... no
  checking how to associate runtime and link libraries... printf %s\n
  checking for ar... ar
  checking for archiver @FILE support... @
  checking for strip... strip
  checking for ranlib... ranlib
  checking command to parse /usr/bin/nm -B output from gcc object... ok
  checking for sysroot... no
  checking for a working dd... /bin/dd
  checking how to truncate binary pipes... /bin/dd bs=4096 count=1
  checking for mt... mt
  checking if mt is a manifest tool... no
  checking how to run the C preprocessor... gcc -E
  checking for ANSI C header files... yes
  checking for sys/types.h... yes
  checking for sys/stat.h... yes
  checking for stdlib.h... yes
  checking for string.h... yes
  checking for memory.h... yes
  checking for strings.h... yes
  checking for inttypes.h... yes
  checking for stdint.h... yes
  checking for unistd.h... yes
  checking for dlfcn.h... yes
  checking for objdir... .libs
  checking if gcc supports -fno-rtti -fno-exceptions... no
  checking for gcc option to produce PIC... -fPIC -DPIC
  checking if gcc PIC flag -fPIC -DPIC works... yes
  checking if gcc static flag -static works... yes
  checking if gcc supports -c -o file.o... yes
  checking if gcc supports -c -o file.o... (cached) yes
  checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
  checking whether -lc should be explicitly linked in... no
  checking dynamic linker characteristics... GNU/Linux ld.so
  checking how to hardcode library paths into programs... immediate
  checking whether stripping libraries is possible... yes
  checking if libtool supports shared libraries... yes
  checking whether to build shared libraries... yes
  checking whether to build static libraries... no
  checking for inline... inline
  checking whether /home/pi/bluew_test/bin/python3 version is >= 2.6... yes
  checking for /home/pi/bluew_test/bin/python3 version... 3.5
  checking for /home/pi/bluew_test/bin/python3 platform... linux
  checking for /home/pi/bluew_test/bin/python3 script directory... ${prefix}/lib/python3.5/site-packages
  checking for /home/pi/bluew_test/bin/python3 extension module directory... ${exec_prefix}/lib/python3.5/site-packages
  checking for python3.5-config... /usr/bin/python3.5-config
  checking for Python headers using /usr/bin/python3.5-config --includes... -I/usr/include/python3.5m -I/usr/include/python3.5m
  checking whether those headers are sufficient... yes
  checking for Python library linker flags using /usr/bin/python3.5-config... -L/usr/lib/python3.5/config-3.5m-arm-linux-gnueabihf -L/usr/lib -lpython3.5m -lpthread -ldl  -lutil -lm  -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
  checking for git... /usr/bin/git
  checking whether you want to build HTML docs... if possible
  checking whether you want to build API docs... if possible
  checking python3 module: docutils... no
  checking for dbus-run-session... /usr/bin/dbus-run-session
  checking whether  understands --generator... no
  checking whether  understands --date... no
  checking whether  understands --time... no
  checking whether  understands --exit-status=2... no
  checking whether  understands --no-raw... no
  checking whether  understands --no-file-insertion... no
  checking whether  understands --cloak-email-addresses... no
  checking whether  understands --input-encoding=UTF-8... no
  checking for pkg-config... /usr/bin/pkg-config
  checking pkg-config is at least version 0.9.0... yes
  checking for DBUS... no
  configure: error: Package requirements (dbus-1 >= 1.6) were not met:

  No package 'dbus-1' found

  Consider adjusting the PKG_CONFIG_PATH environment variable if you
  installed software in a non-standard prefix.

  Alternatively, you may set the environment variables DBUS_CFLAGS
  and DBUS_LIBS to avoid the need to call pkg-config.
  See the pkg-config man page for more details.
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-bbltm1fj/dbus-python/setup.py", line 106, in <module>
      'build_ext': BuildExt,
    File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/home/pi/bluew_test/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 204, in run
      self.run_command('build')
    File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-bbltm1fj/dbus-python/setup.py", line 62, in run
      cwd=builddir)
    File "/usr/lib/python3.5/subprocess.py", line 271, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/tmp/pip-build-bbltm1fj/dbus-python/configure', '--disable-maintainer-mode', 'PYTHON=/home/pi/bluew_test/bin/python3', '--prefix=/tmp/pip-build-bbltm1fj/dbus-python/build/temp.linux-armv7l-3.5/prefix']' returned non-zero exit status 1

  ----------------------------------------
  Failed building wheel for dbus-python
  Running setup.py clean for dbus-python
  Running setup.py bdist_wheel for vext.gi ... error
  Complete output from command /home/pi/bluew_test/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-bbltm1fj/vext.gi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpwa1vixclpip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  installing to build/bdist.linux-armv7l/wheel
  running install
  vext.gi Install
  Checking .pth file support in build/bdist.linux-armv7l/wheel/
  /home/pi/bluew_test/bin/python3 -E -c pass
  TEST FAILED: build/bdist.linux-armv7l/wheel/ does NOT support .pth files
  error: bad install directory or PYTHONPATH

  You are attempting to install a package to a directory that is not
  on PYTHONPATH and which Python does not read ".pth" files from.  The
  installation directory you specified (via --install-dir, --prefix, or
  the distutils default setting) was:

      build/bdist.linux-armv7l/wheel/

  and your PYTHONPATH environment variable currently contains:

      ''

  Here are some of your options for correcting the problem:

  * You can choose a different installation directory, i.e., one that is
    on PYTHONPATH or supports .pth files

  * You can add the installation directory to the PYTHONPATH environment
    variable.  (It must then also be on PYTHONPATH whenever you run
    Python and want to use the package(s) you are installing.)

  * You can set up the installation directory to support ".pth" files by
    using one of the approaches described here:

    https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations

  Please make the appropriate changes for your system and try again.

  ----------------------------------------
  Failed building wheel for vext.gi
  Running setup.py clean for vext.gi
Failed to build dbus-python vext.gi
Installing collected packages: dbus-python, ruamel.yaml, vext, vext.gi, bluew
  Running setup.py install for dbus-python ... error
    Complete output from command /home/pi/bluew_test/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-bbltm1fj/dbus-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-b9nf4dz8-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/bluew_test/include/site/python3.5/dbus-python:
    running install
    running build
    creating /tmp/pip-build-bbltm1fj/dbus-python/build
    creating /tmp/pip-build-bbltm1fj/dbus-python/build/temp.linux-armv7l-3.5
    checking whether make supports nested variables... yes
    checking whether to enable maintainer-specific portions of Makefiles... no
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... no
    checking for mawk... mawk
    checking whether make sets $(MAKE)... yes
    checking whether UID '1000' is supported by ustar format... yes
    checking whether GID '1000' is supported by ustar format... yes
    checking how to create a ustar tar archive... gnutar
    checking build system type... armv7l-unknown-linux-gnueabihf
    checking host system type... armv7l-unknown-linux-gnueabihf
    checking for native Windows host... no
    checking how to print strings... printf
    checking for style of include used by make... GNU
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking whether gcc understands -c and -o together... yes
    checking dependency style of gcc... gcc3
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for fgrep... /bin/grep -F
    checking for ld used by gcc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 1572864
    checking how to convert armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format... func_convert_file_noop
    checking how to convert armv7l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
    checking for /usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... no
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver @FILE support... @
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for sysroot... no
    checking for a working dd... /bin/dd
    checking how to truncate binary pipes... /bin/dd bs=4096 count=1
    checking for mt... mt
    checking if mt is a manifest tool... no
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -fPIC -DPIC
    checking if gcc PIC flag -fPIC -DPIC works... yes
    checking if gcc static flag -static works... yes
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    checking for inline... inline
    checking whether /home/pi/bluew_test/bin/python3 version is >= 2.6... yes
    checking for /home/pi/bluew_test/bin/python3 version... 3.5
    checking for /home/pi/bluew_test/bin/python3 platform... linux
    checking for /home/pi/bluew_test/bin/python3 script directory... ${prefix}/lib/python3.5/site-packages
    checking for /home/pi/bluew_test/bin/python3 extension module directory... ${exec_prefix}/lib/python3.5/site-packages
    checking for python3.5-config... /usr/bin/python3.5-config
    checking for Python headers using /usr/bin/python3.5-config --includes... -I/usr/include/python3.5m -I/usr/include/python3.5m
    checking whether those headers are sufficient... yes
    checking for Python library linker flags using /usr/bin/python3.5-config... -L/usr/lib/python3.5/config-3.5m-arm-linux-gnueabihf -L/usr/lib -lpython3.5m -lpthread -ldl  -lutil -lm  -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
    checking for git... /usr/bin/git
    checking whether you want to build HTML docs... if possible
    checking whether you want to build API docs... if possible
    checking python3 module: docutils... no
    checking for dbus-run-session... /usr/bin/dbus-run-session
    checking whether  understands --generator... no
    checking whether  understands --date... no
    checking whether  understands --time... no
    checking whether  understands --exit-status=2... no
    checking whether  understands --no-raw... no
    checking whether  understands --no-file-insertion... no
    checking whether  understands --cloak-email-addresses... no
    checking whether  understands --input-encoding=UTF-8... no
    checking for pkg-config... /usr/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for DBUS... no
    configure: error: Package requirements (dbus-1 >= 1.6) were not met:

    No package 'dbus-1' found

    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.

    Alternatively, you may set the environment variables DBUS_CFLAGS
    and DBUS_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-bbltm1fj/dbus-python/setup.py", line 106, in <module>
        'build_ext': BuildExt,
      File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/pi/bluew_test/lib/python3.5/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run
        self.run_command('build')
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-bbltm1fj/dbus-python/setup.py", line 62, in run
        cwd=builddir)
      File "/usr/lib/python3.5/subprocess.py", line 271, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/tmp/pip-build-bbltm1fj/dbus-python/configure', '--disable-maintainer-mode', 'PYTHON=/home/pi/bluew_test/bin/python3', '--prefix=/tmp/pip-build-bbltm1fj/dbus-python/build/temp.linux-armv7l-3.5/prefix']' returned non-zero exit status 1

    ----------------------------------------
Command "/home/pi/bluew_test/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-bbltm1fj/dbus-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-b9nf4dz8-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/bluew_test/include/site/python3.5/dbus-python" failed with error code 1 in /tmp/pip-build-bbltm1fj/dbus-python/

Seems to be complaining about dbus-1 so:

(bluew_test) pi@RPi3:~ $ pip3 install dbus-1
Collecting dbus-1
  Could not find a version that satisfies the requirement dbus-1 (from versions: )
No matching distribution found for dbus-1

As it is dbus that is turning out to be a problem but your library appears to a pure python I thought I would try cloning and running directly:

(bluew_test) pi@RPi3:~ $ git clone https://github.com/nullp0tr/bluew.git
Cloning into 'bluew'...
remote: Counting objects: 307, done.
remote: Compressing objects: 100% (96/96), done.
remote: Total 307 (delta 95), reused 111 (delta 56), pack-reused 154
Receiving objects: 100% (307/307), 108.78 KiB | 32.00 KiB/s, done.
Resolving deltas: 100% (165/165), done.
(bluew_test) pi@RPi3:~ $ cd bluew
(bluew_test) pi@RPi3:~/bluew $ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bluew
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/bluew/bluew/__init__.py", line 14, in <module>
    from .api import connect, disconnect, remove
  File "/home/pi/bluew/bluew/api.py", line 23, in <module>
    from .connections import Connection
  File "/home/pi/bluew/bluew/connections.py", line 14, in <module>
    import bluew.plugables
  File "/home/pi/bluew/bluew/plugables.py", line 13, in <module>
    from bluew.dbusted import DBusted
  File "/home/pi/bluew/bluew/dbusted/__init__.py", line 13, in <module>
    from .dbusted import DBusted
  File "/home/pi/bluew/bluew/dbusted/dbusted.py", line 20, in <module>
    from dbus.mainloop.glib import DBusGMainLoop
ImportError: No module named 'dbus'

As the error is dbus which I know exists outside of the venv I thought I'd try that:

(bluew_test) pi@RPi3:~/bluew $ deactivate 
pi@RPi3:~/bluew $ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bluew
>>> 

That seems to have been successful!

So I can do things now just not within a venv. I am OK with closing this issue if you want. Or, I can test things if that helps.

Thanks, Barry

nullp0tr commented 6 years ago

Hey barry, Testing things out first would be appreciated:) I'll edit the installation steps, cause the last problem you're running into is because of using python-dbus which relies on dbus-1 which is not installable with pip, but only with your system package manager, so for debian the following should do the trick: sudo apt-get install libdbus-1-dev and there's not really a way to install that locally in the virtual env, without going through lots of work. I'm currently also looking for alternatives for python-dbus, which use asyncio instead so I can also remove the dependency on GLib as well. Let me know how it goes for you!

ukBaz commented 6 years ago

Alternatives for python-dbus would be good. As would using asyncio...

I've created a venv with --system-site-packages and it is working on the clone. I suspect if you update the setup.py to remove the install_requires we should probably be good.

pi@RPi3:~ $ mkdir venv_with_systempackages
pi@RPi3:~ $ python3 -m venv --system-site-packages /home/pi/venv_with_systempackages
pi@RPi3:~ $ source venv_with_systempackages/bin/activate
(venv_with_systempackages) pi@RPi3:~ $ cd bluew/
(venv_with_systempackages) pi@RPi3:~/bluew $ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bluew
>>> 
nullp0tr commented 6 years ago

I removed the packages from install_requires, and edited the README.md file to include system packages needed. I found this library https://github.com/ldo/dbussy some time ago, which removes the need for GLib but I haven't had the time to fully check it out yet. I might do that some time this week, and if it's worth it to transition to it, the c dbus requirements can also be included with bluew, so that no one has to install them globally.