python卸载pip_如何使用pip3或其他方式干净地卸载我的python包?

本文讲述了在Python中,通过setup.py安装程序后,使用pip3 uninstall命令未能删除对应的命令入口。作者发现pip3 install然后pip3 uninstall可以成功移除程序及其入口。建议始终使用pip进行Python应用的安装和卸载,以确保完整清理。
摘要由CSDN通过智能技术生成

1586010002-jmsa.png

this is my setup.py file for installing my python program, after the installation using python3 setup.py install an entry to my program was created named testmain , when i did pip3 freeze it showed abc==0.1 in its output ,so i uninstalled it using pip3 with pip3 uninstall abc , though the packages were uninstalled but there still existed the entry testmain on my path , is there a way that pip3 also removes this entry during the uninstall or any other way that i can cleanly uninstall my programs under same scenario ?

from setuptools import setup

setup(name='abc',

version='0.1',

description='test',

url='http://github.com/rjdp',

author='rajdeep',

author_email='rajdeep.sharma@rtcamp.com',

license='MIT',

packages=['cli'],

install_requires=[

'cement',

],

entry_points = {

'console_scripts': ['testmain=cli.abc:main'],

},

zip_safe=False)

解决方案

Instead of python3 setup.py install use:

pip3 install .

then

pip3 uninstall abc

This will remove testmain.

I had the same question today and spent the entire morning trying to figure out why the script wouldn't uninstall. Nothing worked until I saw Ramana's answer here: https://askubuntu.com/questions/38692/how-does-one-remove-applications-installed-through-python-setup-py-install

"You should always install Python apps with "pip". pip supports uninstall option." and the example in the commment on how local path is supported.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值