question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

install --root=... tries to remove previously globally installed version

See original GitHub issue

I tried to do pip install --root=... some-wheel-file.whl, which failed with a permission error because it tried to uninstall a globally installed version(!) and I luckily didn’t run with root permissions.

If i had, pip would have fucked up my package-manager-controlled global install.

What should happen is the same as with --user: install all dependencies to --root, then check if the package itself is installed in --root, remove it if so, and (re)install it to there. Leave it alone if it’s installed elsewhere.

Related to #3029


I can circumvent it by doing --root=... --ignore-installed --no-deps, but that is a hack:

What it does is ignoring installed packages to make it not try to remove previously installed versions (which it shouldn’t do in the first place if those versions don’t live in the specified --root!), and then I make it not install dependencies so that i end up with only that package installed in my --root.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:9
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
patatetomcommented, Aug 28, 2019

hi, for my part, I use pip --root=... to install packages in a folder that serves as a basis for building a live system, a bit like a virtualenv… these packages are not directly available with the package manager of my distribution.

3reactions
yan12125commented, May 11, 2018

Seems the result is similar for --prefix:

$ pip install --prefix=/home/yen/usr pip
Requirement already satisfied: pip in /home/yen/.local/lib/python3.6/site-packages (10.0.1)

pip shouldn’t look for installed packages in default paths (e.g., ~/.local/lib/python3.6/site-packages) at all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change default global installation directory for node.js ...
trying to install global packages into C:\Program Files (x86)\nodejs\ gave me Run ... Then create a folder called npm-cache at the root of...
Read more >
npm-ci
Clean install a project. ... Select CLI Version: ... Operates in "global" mode, so that packages are installed into the prefix folder instead...
Read more >
npm, pnpm, and Yarn | IntelliJ IDEA Documentation - JetBrains
Select npm, yarn, or pnpm to use the system default installation. ... IDEA displays a suggestion list with all the previous versions of...
Read more >
yarn add
yarn add package-name installs the “latest” version of the package. ... manager like npm previously, you may be looking for how to add...
Read more >
Download and install - The Go Programming Language
Managing Go installations -- How to install multiple versions and uninstall. ... Remove any previous Go installation by deleting the /usr/local/go folder ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found