如何查看aiohttp版本?Ubuntu16.04下aiohttp版本查询问题
General Ways to Find aiohttp Version
No matter what operating system you're on, these methods will reliably get your installed aiohttp version:
Use the Python Interpreter:
Open your terminal, typepython(orpython3if you're working with Python 3) to enter the interactive shell, then run:import aiohttp print(aiohttp.__version__)This directly pulls the version number from the installed package in that Python environment.
Use pip:
If you installed aiohttp via pip, filter your installed packages to find aiohttp:- For Python 2:
pip list | grep aiohttp - For Python 3:
pip3 list | grep aiohttp
Or get detailed package info including version withpip show aiohttp(orpip3 show aiohttp).
- For Python 2:
Fixing the Ubuntu 16.04 "command not found" Issue
The error -bash: aiohttp: command not found is totally normal here—older versions of aiohttp don't include a command-line interface (CLI) tool, so running aiohttp -V won't work. Even newer versions might require extra setup for the CLI, so it's not a reliable way to check the version.
Since your system's default Python is 2.7.12, here's how to check the aiohttp version for that environment:
Check with pip for Python 2:
Runpip show aiohttpin your terminal. If aiohttp is installed, you'll see output like this:Name: aiohttp Version: 3.8.4 Location: /usr/local/lib/python2.7/dist-packages Requires: async-timeout, attrs, chardet, multidict, yarlIf you get "Package(s) not found", that means aiohttp isn't installed for Python 2.7.
Check via Python 2 Shell:
Launch Python 2 by typingpythonin your terminal, then run:import aiohttp print(aiohttp.__version__)If this throws an
ImportError, aiohttp isn't installed in your Python 2 environment.
A quick note: Python 2 is no longer supported, so if you can, consider switching to Python 3. Install aiohttp for Python 3 with sudo pip3 install aiohttp, then check the version using pip3 show aiohttp or the Python 3 interpreter.
内容的提问来源于stack exchange,提问作者GoodtheBest

