Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipenv uninstall leaves entry in Pipfile [packages] #3529

Closed
jtmoon79 opened this issue Feb 12, 2019 · 6 comments
Closed

pipenv uninstall leaves entry in Pipfile [packages] #3529

jtmoon79 opened this issue Feb 12, 2019 · 6 comments

Comments

@jtmoon79
Copy link

tl;dr pipenv uninstall setuptools does not remove the entry from Pipfile section [packages].

Steps to replicate

  1. create a new project and install a virtual environment
$ mkdir proj1

$ cd proj1

$ pipenv --python 3.7
Creating a virtualenv for this project…
…
Successfully created virtual environment!
Virtualenv location: C:\Users\ulug\.virtualenvs\temp1-wqpe6Y-N
Creating a Pipfile for this project…

$ pipenv install setuptools
…

The generated Pipfile has contents

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
setuptools = "*"

[requires]
python_version = "3.7"

Uninstall setuptools

$ pipenv uninstall setuptools

UNEXPECTED: Pipfile still has entry setuptools = "*" in section [packages] (the Pipfile has not changed).
EXPECTED: pipenv would remove entry setuptools = "*" in section [packages]. The --help output reads

$ pipenv --help
…
 uninstall  Un-installs a provided package and removes it from Pipfile.
…

$ pipenv --support

Pipenv version: '2018.11.26'

Pipenv location: 'c:\\python\\python37\\lib\\site-packages\\pipenv'

Python location: 'c:\\python\\python37\\python.exe'

Python installations found:

  • 3.7.1: C:\Python\Python37\python.exe
  • 3.6.7: C:\Python\Python36\python.exe
  • 3.5: C:\Python\Python35\python.exe
  • 3.4: C:\Python\Python34\python.exe

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.1',
 'os_name': 'nt',
 'platform_machine': 'AMD64',
 'platform_python_implementation': 'CPython',
 'platform_release': '10',
 'platform_system': 'Windows',
 'python_full_version': '3.7.1',
 'python_version': '3.7',
 'sys_platform': 'win32'}
@geoffroy-noel-ddh
Copy link

Well spotted, I think setuptools is a particular case here. You'll get the same issue with 'distribute' and 'pip' packages.

If you do pipenv install setuptools, pipenv doesn't add it to the Pipfile.lock nor does it actually try to install it in the virtual env. So at least it should warn the user about that.

This might be related to #3523 , where pipenv will add stuff to Pipfile even if install doesn't actually do anything.

@frostming
Copy link
Contributor

@geoffroy-noel-ddh Thanks for your explanation, close this issue now.

@sandipsutariya
Copy link

Same is happening with 'wheel' package. I can see entry in Piplock file as well when I install it. But is this not getting removed in case if pipenv uninstall

@susca
Copy link

susca commented May 9, 2020

This also happens with data-science-types.

@zvolsky
Copy link

zvolsky commented Jul 27, 2020

also happens .... always?

@tombohub
Copy link

tombohub commented Dec 11, 2020

happens with every package if you put version also
pipenv uninstall django==3.1.0

so you can install with version, but you cannot uninstall with version...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants