crossbario / autobahn-python

WebSocket and WAMP in Python for Twisted and asyncio
https://crossbar.io/autobahn
MIT License
2.47k stars 763 forks source link

'Distribution' object has no attribute 'convert_2to3_doctests' #1611

Closed psychochair closed 1 year ago

psychochair commented 1 year ago

Hello

I am trying to install daphne with PIP, which uses autobahn. So, when I am trying to install autobahn (I am using Twisted==22.10.0) with the following command: pip install autobahn[twisted] I get the following error:

Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-3dpw3xwg/autobahn_fa227d9a21ae4a298197ecfbd055970f/setup.py", line 248, in <module>
          setup(
        File "/home/pointlaz/django-apps/Control-Server/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, 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 "/home/pointlaz/django-apps/Control-Server/venv/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run
          return orig.install.run(self)
        File "/usr/lib/python3.8/distutils/command/install.py", line 589, in run
          self.run_command('build')
        File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/usr/lib/python3.8/distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/home/pointlaz/django-apps/Control-Server/venv/lib/python3.8/site-packages/setuptools/command/build_py.py", line 53, in run
          self.build_package_data()
        File "/home/pointlaz/django-apps/Control-Server/venv/lib/python3.8/site-packages/setuptools/command/build_py.py", line 126, in build_package_data
          srcfile in self.distribution.convert_2to3_doctests):
      AttributeError: 'Distribution' object has no attribute 'convert_2to3_doctests'
      [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.
╰─> autobahn

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I am running this inside a virtual env with pip 23.0, on an Ubuntu 20.04.5 LTS machine. Let me know if you need more info.

oberstet commented 1 year ago

no idea, works in the CI with older python and current twisted

https://github.com/crossbario/autobahn-python/actions/runs/3925457332

but your setuptools might be too old (for the plugin system of your twisted version, which is what triggers this I guess)

(cpy311_5) oberstet@intel-nuci7:~/scm/crossbario/crossbar$ python -V
Python 3.11.1
(cpy311_5) oberstet@intel-nuci7:~/scm/crossbario/crossbar$ pip show setuptools
Name: setuptools
Version: 67.0.0
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: https://github.com/pypa/setuptools
Author: Python Packaging Authority
Author-email: distutils-sig@python.org
License: 
Location: /home/oberstet/cpy311_5/lib/python3.11/site-packages
Requires: 
Required-by: autobahn, crossbar, pyinstaller, zope.interface

IOW: you could try pip install -U setuptools and then pip install twisted - or directly pip install autobahn[twisted]