Article 6MFHF python code error: ModuleNotFoundError: No module named 'mariadb'

python code error: ModuleNotFoundError: No module named 'mariadb'

by
shams
from LinuxQuestions.org on (#6MFHF)
Hi,
I successfully installed the mariadb python module to the python virtual enviroment '/home/user/venv' with the command '/home/user/venv/bin/pip install mariadb' in arch linux, and activated the venv with command '/home/user/venv/bin/activate' now when run the python code:
Code:import mariadb
import sys
import configparserThe code cannot import the mariadb module from '/home/user/venv', and print this error:
Code:ModuleNotFoundError: No module named 'mariadb'
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments