Pip uninstall not removing the package
stduhpf opened this issue · comments
$: python examples/python/example-alpaca.py
Traceback (most recent call last):
File "examples/python/example-alpaca.py", line 1, in <module>
from fastllama import Model
ImportError: cannot import name 'Model' from 'fastllama' (unknown location)
$: pip install git+https://github.com/PotatoSpudowski/fastLLaMa.git@main
[...]
$: pip list |grep fastllama|wc -l
1
$: python examples/python/example-alpaca.py
[works as expected]
$: pip uninstall fastllama -y
Found existing installation: fastllama 1.0.0
Uninstalling fastllama-1.0.0:
Successfully uninstalled fastllama-1.0.0
$: pip list |grep fastllama|wc -l
0
$: python examples/python/example-alpaca.py
[still works????]
Im not sure what might be the cause of this issue... The only way I found to remove is to delete it directly from the site-packages
folder.
Here is the script I use to completly rebuild the project, (It's somehow related to this issue, so I'll leave it there)
#!/bin/bash
# full uninstall
pip uninstall fastllama -y
python setup.py develop -u
libpath="$(dirname $(dirname $(which pip)))/lib"
rm -r $libpath/$(ls $libpath | grep ^python)/site-packages/fastllama/
# build either current branch, or branch given as cli arg
if [ -z "$1" ]
then
branch=$(git rev-parse --abbrev-ref HEAD)
else
branch=$1
fi
pip install git+file://$PWD@$branch
Interesting, I will think about ways to do this meanwhile for now as you mentioned the only proper way is to remove it from site packages directly.
Let's keep this issue open for now and I will pick it up when I get some bandwidth from other tasks.