2

I am trying to install the python module pyobjus (this is the one that fails to install another module).

But I always get some bug during installation. I tried to switch to other python versions, reinstall pip, use option --no-cache-dir, etc, but couldn't manage to get past this bug:

 $ pip3 install pyobjus
Defaulting to user installation because normal site-packages is not writeable
Collecting pyobjus
  Using cached pyobjus-1.2.0.tar.gz (165 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf
       cwd: /tmp/pip-install-4k26drr5/pyobjus
  Complete output (19 lines):
  Pyobjus platform is linux
  Traceback (most recent call last):
    File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 150, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 130, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 254, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 145, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 35, in <module>
      class PyObjusBuildExt(build_ext, object):
  NameError: name 'build_ext' is not defined
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf Check the logs for full command output.

Any help would be greatly appreciated. My OS is Linux Mint 19.3.

I saw this question which is about the same problem, but following the links did not bring any answer. It says PyObjus is designed for MacOS, but then why does the module katrain, supposedly compatible with linux, tries to install it when running "pip3 install katrain" (giving the same error as above) ?

Edit adter Marat's suggestion: I removed the test for ios, the installation goes a bit further, but fails because Python.h is missing. when trying to install python3-dev, apt-get says that broken packages such as python3.6-dev are flagged "left as is", so it cannot install the required ones. Is there a way to fix the python installation, which seems to be broken ? I am afraid to break all the system if I mess up with it too much, but there is clearly a problem with my installation...

Fixed the above issue by reinstalling stuff, now it is CoreFoundation.h that is missing...

D K
  • 133
  • 5
  • it is a new bug in pyobjus 1.2. Try installing an older oversion `pip3 install pyobjus==1.1.0` – Marat Nov 21 '20 at 23:04
  • @Marat it gives the same error – D K Nov 21 '20 at 23:08
  • then there is no easy workaround. You still can download package archive, unpack, fix `setup.py` in line 23 to disable check for Mac OS, and install from a local source – Marat Nov 21 '20 at 23:10
  • 1
    I downloaded the project and looked at its `setup.py`. That code will only work properly on a Mac because it specifically checks `sys.platform` for "darwin" and "ios". There is an out, it will try to install if you've set the environment variable `KIVYIOSROOT`. Otherwise, `setup.py` will crash with this error instead of exiting nicely with an error message. You may want to contact the developers to see what is up with a linux install. https://pypi.org/project/pyobjus/. – tdelaney Nov 21 '20 at 23:11
  • @Marat - that's a good solution. I'd try adding `dev_platform = 'ios'` right before the check so that the installer attempts to build `pyobjus.c`. – tdelaney Nov 21 '20 at 23:13
  • @Marat thanks, it went a little further, but apparently there are deeper problem with my python installation. See the edit in the question. Do you know how I could fix it ? – D K Nov 21 '20 at 23:43
  • `katrain` doesn't install `pyobjus` on Linux. This is the list of dependencies from `pip install katrain` in a new empty virtual env: *Installing collected packages: cython, chardet, idna, urllib3, certifi, requests, pillow, docutils, pygments, Kivy-Garden, kivy, kivymd, screeninfo, katrain Successfully installed Kivy-Garden-0.1.4 certifi-2020.11.8 chardet-3.0.4 cython-0.29.14 docutils-0.16 idna-2.10 katrain-1.5.0 kivy-2.0.0rc2 kivymd-0.104.1 pillow-8.0.1 pygments-2.7.2 requests-2.25.0 screeninfo-0.6.6 urllib3-1.26.2* – phd Nov 21 '20 at 23:48
  • @phd when doing pip install katrain, an error is raised by PyObjus, the same as when doing pip install pyobjus – D K Nov 22 '20 at 00:01
  • Actually "pip install katrain --no-deps" worked, so weird ! thanks a lot ! – D K Nov 22 '20 at 00:11

0 Answers0