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
- Kafka error: Kafka. Errors. NoBrokersAvailable: NoBrokersAvailable
- Unsupported appears in the PyCharm configuration environment
- Linux View the Python installation path, version number
- Install and uninstall PyCharm in Ubuntu
- How to use PyCharm to write a project “Use Tutorial”
- kafka.errors.NoBrokersAvailable: NoBrokersAvailable #1482
- Kafka SSL with Python: kafka.errors.NoBrokersAvailable: NoBrokersAvailable