Problem description

Brief description: In the course of big data experiment, I wrote a script using PyChart and encountered problems when starting Kafka. The Producer.py file reported an error, but the printed information was expected to appear, but the error was reported

consumer = KafkaConsumer('DAILY_SALES', Bootstrap_servers = [' 0.0.0.0:9092]) File "/ anaconda3 / anaconda/lib/python3.6 / site - packages/kafka/consumer group. The p y", line 340, in __init__ self._client = KafkaClient(metrics=self._metrics, * * the self in the config File) "/ anaconda3 / anaconda/lib/python3.6 / site - packages/kafka/client_async. Py", line 219, in __init__ self.config['api_version'] = self.check_version(timeout=check_timeout) File "/ anaconda3 anaconda/lib/python3.6 / site - packages/kafka/client_async. Py", line 839, in check_version raise Errors.NoBrokersAvailable() kafka.errors.NoBrokersAvailable: NoBrokersAvailable

The code above is not the actual error message, but similar to the above, the main error is kafka. Errors. NoBrokersAvailable: NoBrokersAvailable

After knowing the error, I searched for the answer and the online answer, but nothing worked. So I rechecked the error message, found a clue, and looked at the configuration of the Python interpreter to see what was causing the error.

Problem analysis

According to the above error message, the version of PyCharm used at the time was the latest version of 2021 and may have a version issue

The Python 3.XXX interpreter is required, but it does not show support for Unsupported. You may need to use a lower version (2019) PyCharm because the version is too high, so try downloading and installing 2019 PyCharm again

Problem solved successfully!

Problem solving

Specific is the analysis of specific error information, change the old version of the IDE

Conclusion improve

Note version and environment compatibility issues. Python 3.5 May be deprecated in the future, so it is not supported in higher versions of IDEs

Related articles

  1. Kafka error: Kafka. Errors. NoBrokersAvailable: NoBrokersAvailable
  2. Unsupported appears in the PyCharm configuration environment
  3. Linux View the Python installation path, version number
  4. Install and uninstall PyCharm in Ubuntu
  5. How to use PyCharm to write a project “Use Tutorial”
  6. kafka.errors.NoBrokersAvailable: NoBrokersAvailable #1482
  7. Kafka SSL with Python: kafka.errors.NoBrokersAvailable: NoBrokersAvailable