The package name is beautifulsoup4, and the same package works on Python 2 and Python 3.
(lor_parser) md@md ~/.MINT18/code/python/lor_parser $ pip install bs4
Requirement already satisfied: bs4 in /home/md/.local/share/virtualenvs/lor_parser-DJIsCP27/lib/python3.8/site-packages (0.0.1)
Requirement already satisfied: beautifulsoup4 in /home/md/.local/share/virtualenvs/lor_parser-DJIsCP27/lib/python3.8/site-packages (from bs4) (4.8.2)
Requirement already satisfied: soupsieve>=1.2 in /home/md/.local/share/virtualenvs/lor_parser-DJIsCP27/lib/python3.8/site-packages (from beautifulsoup4->bs4) (1.9.5)
(lor_parser) md@md ~/.MINT18/code/python/lor_parser $ python index.py
Traceback (most recent call last):
File "index.py", line 1, in <module>
from urllib import urlopen
ImportError: cannot import name 'urlopen' from 'urllib' (/usr/lib/python3.8/urllib/__init__.py)
То что вы все это делали и уверены что оно будет работать - так себе аргумент
(flask_adminka) md@md ~/.MINT18/code/python/flask_adminka $ pipenv install redis
Installing redis…
Adding redis to Pipfile's [packages]…
✔ Installation Succeeded
Pipfile.lock (9d38ef) out of date, updating to (ac8e32)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✘ Locking Failed!
[pipenv.exceptions.ResolutionFailure]: File "/home/md/.local/lib/python3.5/site-packages/pipenv/resolver.py", line 61, in resolve
[pipenv.exceptions.ResolutionFailure]: return resolve_deps(
[pipenv.exceptions.ResolutionFailure]: File "/home/md/.local/lib/python3.5/site-packages/pipenv/utils.py", line 718, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree, hashes, markers_lookup, resolver = actually_resolve_deps(
[pipenv.exceptions.ResolutionFailure]: File "/home/md/.local/lib/python3.5/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "/home/md/.local/lib/python3.5/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches psycopg-binary
[pipenv.exceptions.ResolutionFailure]: No versions found
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches psycopg-binary
No versions found
Was https://pypi.org/simple reachable?
[pipenv.exceptions.ResolutionFailure]: return resolve_deps(
[pipenv.exceptions.ResolutionFailure]: File "/home/md/.local/lib/python3.5/site-packages/pipenv/utils.py", line 718, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree, hashes, markers_lookup, resolver = actually_resolve_deps(
[pipenv.exceptions.ResolutionFailure]: File "/home/md/.local/lib/python3.5/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "/home/md/.local/lib/python3.5/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches psycopg-binary
[pipenv.exceptions.ResolutionFailure]: No versions found
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches psycopg-binary
No versions found
Was https://pypi.org/simple reachable?
у вас НЕТ транзакции и на постгрес и на редис одновременно, и это ключевой момент
транзакции и на постгрес и на редис одновременно
@app.route('/auth_request', methods=['POST'])
def auth_request():
import psycopg2
import hashlib
db_conn = psycopg2.connect(
database='flask_adminka',
user='flask_admin',
password='flask_admin',
host='localhost'
)
db_cursor = db_conn.cursor()
password_hash = hashlib.sha1(b'flask_admin3').hexdigest()
req = "select * from users where password_hash='" + password_hash + "'"
print('----password_hash', password_hash)
print('----req', req)
db_cursor.execute(req)
records = db_cursor.fetchall()
for row in records:
print("Id = ", row[0], )
print("pass = ", row[1])
print("email = ", row[2])
print("active = ", row[3])
apt install python3-setuptools python3-pip python3.6-venv python3.6-dev
sudo apt-get install python3.*
md@md ~/.MINT18/code/python/project2 $ setuptools --version
setuptools: команда не найдена
md@md ~/.MINT18/code/python/project2 $ pip --version
Программа 'pip' на данный момент не установлена. Вы можете установить её, выполнив:
sudo apt install python-pip
md@md ~/.MINT18/code/python/project2 $ pip3 --version
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)
md@md ~/.MINT18/code/python/project2 $ virtualenv --version
15.0.1