'No module named 'mlxtend'
I am unable to install the mlextend package in Jupyter Python3 notebook
I have tried pip install mlxtend or pip3 install mlxtend, but either it shows syntax error for some reason on Python2 or it tells to try on the command line in python3. I have tried installing it on command line but it shows "ERROR: Could not find a version that satisfies the requirement mlextend (from versions: none) ERROR: No matching distribution found for mlextend"
from mlxtend.frequent_patterns import apriori
from mlxtend.frequent_patterns import association_rules
ModuleNotFoundError Traceback (most recent call
last)
<ipython-input-3-73c97be96c5f> in <module>()
----> 1 from mlxtend.frequent_patterns import apriori
2 from mlxtend.frequent_patterns import association_rules
ModuleNotFoundError: No module named 'mlxtend'`enter code here`
Solution 1:[1]
You need to use the following command:
pip install mlxtend
You are currently trying to install mlextend (which does not exist) instead of mlxtend.
Solution 2:[2]
I had the same issue recently. What worked was importing the module first, and then getting the components:
import mlxtend
from mlxtend.frequent_patterns import apriori
from mlxtend.frequent_patterns import association_rules
Solution 3:[3]
To add to the above possible solutions. Under Anaconda/Miniconda environments it is also possible to use conda. Among the various options under https://anaconda.org/conda-forge/mlxtend the following worked for me
conda install -c conda-forge mlxtend
Solution 4:[4]
'pip install' works on Python2,if you install for Python3, use
pip3 install mlxtend instead
Solution 5:[5]
Use !pip install mlxtend. It will definitely work.
Solution 6:[6]
#Import the libraries
#To install mlxtend run : pip install mlxtend
import pandas as pd
from mlxtend.preprocessing import TransactionEncoder
from mlxtend.frequent_patterns import association_rules,apriori
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nordle |
| Solution 2 | SilentStone |
| Solution 3 | |
| Solution 4 | Phùng Hưng Thịnh |
| Solution 5 | RobC |
| Solution 6 | Suraj Rao |
