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

ERROR: Cannot uninstall 'PyYAML' #349

Closed
waffletower opened this issue Nov 19, 2019 · 8 comments
Closed

ERROR: Cannot uninstall 'PyYAML' #349

waffletower opened this issue Nov 19, 2019 · 8 comments

Comments

@waffletower
Copy link

waffletower commented Nov 19, 2019

Distributing PyYAML via distutils is decidedly user hostile. Pip cannot cleanly remove existing PyYAML distributions. There are many situations where users need the ability to upgrade to a modern version of pyyaml, but a version is already installed (For example, AWS AMI distributions).

I strongly recommend that future versions of PyYAML distribute via setuputils instead.

@petebachant
Copy link

Also running into this issue working with conda environments that install some dependencies via pip.

@dojeda
Copy link

dojeda commented Feb 10, 2020

I think the problem presents itself on conda when you have a conda dependency that uses pyyaml, and a pip dependency that also uses pyyaml.

For anyone else having this particular problem, in my case I managed to solve it by adding pyyaml>=5.1.2,<5.2 on my environment dependencies (on regular conda dependencies, not in pip dependencies).

@bsolomon1124
Copy link
Contributor

I strongly recommend that future versions of PyYAML distribute via setuputils instead.

I'm not sure if this is actually what's going on.

I believe that even if setup.py calls distutils.setup(), recent versions of pip will actually monkey-patch that to replace it with setuptools.setup() if setuptools is available.

Not that I disagree that distutils should be removed altogether...

@kitterma
Copy link

kitterma commented Jun 5, 2020 via email

@bsolomon1124
Copy link
Contributor

So I think when distutils would come into play is if the user is installing via python setup.py install without setuptools installed. Which is another motivation to drop that ancient way of installing from the README.

@arogozhnikov
Copy link

pyyaml packaged with distutils is strangely observed on ubuntu arm64 images, but not amd64. What could be the reason?

I can confirm that's very annoying to see builds failing without any sensible way to remove existing package

@pythonmobile
Copy link

can we please get this resolved? ubuntu 20.04 amd64 - creates trouble for pip

@nitzmahone
Copy link
Member

If you're still seeing this, it's likely because of the way Ubuntu/Debian are packaging it or you're using stale packages. Trying to use pip to manage packages installed by the OS is not going to end well, for a lot of reasons (which is why pip removed the ability to do so quite awhile back). You'll need to either install to a user location or a virtualenv, or uninstall the OS pyyaml package using the OS package manager. Pyyaml itself completely switched to setuptools nearly a year ago with the 5.4 release.

sstamenova added a commit to llvm/llvm-project that referenced this issue Feb 7, 2023
Some Ubuntu 20.04 images come with PyYAML 5.3.1 pre-installed through distutils. This makes pip very angry. See yaml/pyyaml#349.

Since older versions of PyYAML should work for mlir, relax the version requirement to ease developer setup.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D143523
CarlosAlbertoEnciso pushed a commit to SNSystems/llvm-debuginfo-analyzer that referenced this issue Feb 8, 2023
Some Ubuntu 20.04 images come with PyYAML 5.3.1 pre-installed through distutils. This makes pip very angry. See yaml/pyyaml#349.

Since older versions of PyYAML should work for mlir, relax the version requirement to ease developer setup.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D143523
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Aug 9, 2024
Some Ubuntu 20.04 images come with PyYAML 5.3.1 pre-installed through distutils. This makes pip very angry. See yaml/pyyaml#349.

Since older versions of PyYAML should work for mlir, relax the version requirement to ease developer setup.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D143523
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Aug 15, 2024
Some Ubuntu 20.04 images come with PyYAML 5.3.1 pre-installed through distutils. This makes pip very angry. See yaml/pyyaml#349.

Since older versions of PyYAML should work for mlir, relax the version requirement to ease developer setup.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D143523
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

8 participants