gene heskett wrote:
On 8/29/22 12:50, Mark Bourne wrote:
Roel Schroeven wrote:
Op 29/08/2022 om 2:55 schreef gene heskett:
On 8/28/22 19:39, Peter J. Holzer wrote:
On 2022-08-28 18:40:17 -0400, gene heskett wrote:
Persuant to my claim the py3.10 is busted, here is a sample. This is me,
trying to make
pronterface, inside a venv: When the package manager version will only run
the gui-less "pronsole"
but nothing else from that all python kit runs as it should or at all.  From the package-managers install in /usr/share/doc/printrun-common/ I
copied requirements.txt
into the venv, and ran this command line:

gene@rock64:~/venv$ pip3 install -r requirements.txt
You are almost certainly *not* in a venv here. First, your prompt
doesn't show the name of the venv,
I've created that several times, as octoprint won''t run without it either. I found a way to autostart it on reboots and octoprint seems happy with it
I agree with Peter: it doesn't look as if you are invoking the pip3 in the venv. Just making the venv-directory the current directory doesn't activate it.

As a diagnostic, ask the OS which pip3 is actually used:

$ type -a pip3

Does that show the pip3 installed in the venv? Or the system-wide one? If it's not the pip3 in the venv, well, then that's the problem (or at least part of the problem). Solution: first check whether the venv really contains 'pip3' (as opposed to eg. just 'pip'): list the contents of the bin subdirectory of the venv. If not, use 'pip' or whatever instead. Then to make sure you use the one in the venv, either activate the venv or explicitly specify the path when invoking pip/pip3 (and likewise for python/python3).

So either (assuming you're using bash):

$ source {path_to_venv}/bin/pip3  # activate the venv

I think this first line should probably be:

$ source {path_to_venv}/bin/activate  # activate the venv

i.e. with `activate` rather than `pip3`?

$ type -a pip3  # check whether now the correct pip3 is used
$ pip3 install -r requirements.txt  # finally invoke pip3

or:

$ {path_to_venv}/bin/pip3 install -r requirements.txt
That got me to showstopper #2: (lengthy warniing)

(venv) gene@rock64:~/printrun/Printrun$ ./venv/bin/pip3 install -r requirements.txt Ignoring pyobjc-framework-Cocoa: markers 'sys_platform == "darwin"' don't match your environment Ignoring pyreadline: markers 'sys_platform == "win32"' don't match your environment Requirement already satisfied: pyserial>=3.0 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 1)) (3.5)
Collecting wxPython==4.1.0
   Using cached wxPython-4.1.0.tar.gz (65.8 MB)
   Preparing metadata (setup.py) ... done
Collecting numpy>=1.8.2
  Using cached numpy-1.23.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.9 MB) Requirement already satisfied: pyglet>=1.1 in ./venv/lib/python3.10/site-packages (from -r requirements.txt (line 4)) (1.5.26)
Collecting cffi
  Using cached cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (449 kB)
Collecting cairocffi
   Using cached cairocffi-1.3.0.tar.gz (88 kB)
   Preparing metadata (setup.py) ... done
Collecting cairosvg>=1.0.9
   Using cached CairoSVG-2.5.2-py3-none-any.whl (45 kB)
Collecting psutil>=2.1
   Using cached psutil-5.9.1-cp310-cp310-linux_aarch64.whl
Collecting lxml>=2.9.1
  Using cached lxml-4.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl (6.6 MB)
Collecting appdirs>=1.4.0
   Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting dbus-python>=1.2.0
   Using cached dbus-python-1.2.18.tar.gz (578 kB)
   Preparing metadata (setup.py) ... done
Collecting pillow
  Using cached Pillow-9.2.0-cp310-cp310-manylinux_2_28_aarch64.whl (3.1 MB)
Collecting six
   Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pycparser
   Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting cssselect2
   Using cached cssselect2-0.6.0-py3-none-any.whl (15 kB)
Collecting tinycss2
   Using cached tinycss2-1.1.1-py3-none-any.whl (21 kB)
Collecting defusedxml
   Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Requirement already satisfied: webencodings in ./venv/lib/python3.10/site-packages (from cssselect2->cairosvg>=1.0.9->-r requirements.txt (line 7)) (0.5.1) Using legacy 'setup.py install' for wxPython, since package 'wheel' is not installed. Using legacy 'setup.py install' for cairocffi, since package 'wheel' is not installed. Using legacy 'setup.py install' for dbus-python, since package 'wheel' is not installed. Installing collected packages: dbus-python, appdirs, tinycss2, six, pycparser, psutil, pillow, numpy, lxml, defusedxml, wxPython, cssselect2, cffi, cairocffi, cairosvg
   Running setup.py install for dbus-python ... error
   error: subprocess-exited-with-error

   × Running setup.py install for dbus-python did not run successfully.
   │ exit code: 1
   ╰─> [166 lines of output]
       running install
/home/gene/printrun/Printrun/venv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
         warnings.warn(
       running build
      creating /tmp/pip-install-2zqkrisr/dbus-python_6642a4f761e742d49b75c39a953ceb6b/build       creating /tmp/pip-install-2zqkrisr/dbus-python_6642a4f761e742d49b75c39a953ceb6b/build/temp.linux-aarch64-3.10
       checking whether make supports nested variables... yes
      checking whether to enable maintainer-specific portions of Makefiles... no
       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 how to run the C preprocessor... gcc -E
       checking for grep that handles long lines and -e... /usr/bin/grep
       checking for egrep... /usr/bin/grep -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 minix/config.h usability... no
       checking minix/config.h presence... no
       checking for minix/config.h... no
       checking whether it is safe to define __EXTENSIONS__... yes
       checking for a BSD-compatible install... /usr/bin/install -c
       checking whether build environment is sane... yes
       checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
       checking for gawk... no
       checking for mawk... mawk
       checking whether make sets $(MAKE)... yes
      checking whether make supports the include directive... yes (GNU style)
       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 dependency style of gcc... gcc3
       checking build system type... aarch64-unknown-linux-gnu
       checking host system type... aarch64-unknown-linux-gnu
       checking for native Windows host... no
       checking how to print strings... printf
       checking for a sed that does not truncate output... /usr/bin/sed
       checking for fgrep... /usr/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 aarch64-unknown-linux-gnu file names to aarch64-unknown-linux-gnu format... func_convert_file_noop       checking how to convert aarch64-unknown-linux-gnu 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... /usr/bin/dd
       checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
       checking for mt... mt
       checking if mt is a manifest tool... no
       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 for gawk... (cached) mawk
       checking for python... /home/gene/printrun/Printrun/venv/bin/python3
       checking for a version of Python >= '2.1.0'... yes
       checking for a version of Python >= '2.7'... yes
       checking for the distutils Python package... yes
      checking for Python include path... <string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives       <string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead       <string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives       <string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
       -I/usr/include/python3.10
      checking for Python library path... <stdin>:4: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives       <stdin>:4: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead       <stdin>:3: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives       <stdin>:3: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead       <stdin>:2: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives       <stdin>:2: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
       -L/usr/lib/aarch64-linux-gnu -lpython3.10
      checking for Python site-packages path... <string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives       <string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
       /home/gene/printrun/Printrun/venv/lib/python3.10/site-packages
      checking python extra libraries... <string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives       <string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
       -lcrypt -ldl  -lm -lm
      checking python extra linking flags... <string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives       <string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
       -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
      checking consistency of all components of python development environment... yes
       checking for python version... 3.10
       checking for python platform... linux
      checking for python script directory... ${prefix}/lib/python3.10/site-packages       checking for python extension module directory... ${exec_prefix}/lib/python3.10/site-packages       <string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
       checking python3 module: sphinx... no
       checking python3 module: sphinx_rtd_theme... no
       checking for dbus-run-session... /usr/bin/dbus-run-session
       checking for pkg-config... /usr/bin/pkg-config
       checking pkg-config is at least version 0.9.0... yes
       checking for dbus-1 >= 1.8... no
       configure: error: Package requirements (dbus-1 >= 1.8) 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 2, in <module>
         File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-2zqkrisr/dbus-python_6642a4f761e742d49b75c39a953ceb6b/setup.py", line 85, in <module>
           setup(
        File "/home/gene/printrun/Printrun/venv/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
           return distutils.core.setup(**attrs)
         File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
           dist.run_commands()
        File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
           self.run_command(cmd)
        File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
           cmd_obj.run()
        File "/home/gene/printrun/Printrun/venv/lib/python3.10/site-packages/setuptools/command/install.py", line 68, in run
           return orig.install.run(self)
        File "/usr/lib/python3.10/distutils/command/install.py", line 619, in run
           self.run_command('build')
        File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
           self.distribution.run_command(command)
        File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
           cmd_obj.run()
        File "/tmp/pip-install-2zqkrisr/dbus-python_6642a4f761e742d49b75c39a953ceb6b/setup.py", line 56, in run
           subprocess.check_call([
         File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
           raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/tmp/pip-install-2zqkrisr/dbus-python_6642a4f761e742d49b75c39a953ceb6b/configure', '--disable-maintainer-mode', 'PYTHON=/home/gene/printrun/Printrun/venv/bin/python3', '--prefix=/tmp/pip-install-2zqkrisr/dbus-python_6642a4f761e742d49b75c39a953ceb6b/build/temp.linux-aarch64-3.10/prefix']' returned non-zero exit status 1.
       [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> dbus-python

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
(venv) gene@rock64:~/printrun/Printrun$


There is help there, but to me its engrish. Next fix?

Activating the venv is easier if you're going to use multiple commands in the venv. Note that activating the venv only has effect on the current shell; other shells are unaffected, and when you close the current shell the venv is not activated anymore. Explicitly using the path is easier for one-off calls, or in things like crontab.


Thank you Mark Bourne, this looks like actual progress in what has turned into a cast iron bitch. I'll not touch that shell till the next advice is tendered. However "echo $PKG_CONFIG_PATH" is
null in this venv.

To be fair, it was Roel Schroeven who posted the steps and the part you're quoting here, and others had pointed in the direction of the venv not having been activated - I just posted a correction to one of Roel's commands. Sorry, I can't help much with your actual problem, but hopefully others can.

--
Mark.
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to