(setup is nearly a copy-paste of #5085)
Tried to editably install a local project using pyproject.toml while the install.user key is set in ~/.config/pip/pip.conf. Failed with the traceback below.
$ cat setup.py
from setuptools import setup
setup(name="foobarbaz")
$ cat pyproject.toml
[build-system]
requires = ["setuptools", "wheel"]
$ cat ~/.config/pip/pip.conf
[install]
user = true
$ pip install -e .
Obtaining file:///tmp/foo
Installing build dependencies ... done
Installing collected packages: foobarbaz
Found existing installation: foobarbaz 0.0.0
Can't uninstall 'foobarbaz'. No files were found to uninstall.
Running setup.py develop for foobarbaz
Complete output from command /bin/python -c "import setuptools, tokenize;__file__='/tmp/foo/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps --user --prefix=:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --user not recognized
----------------------------------------
Can't roll back foobarbaz; was not uninstalled
Command "/bin/python -c "import setuptools, tokenize;__file__='/tmp/foo/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps --user --prefix=" failed with error code 1 in /tmp/foo/
As a side note, note also the spurious error message: Found existing installation: foobarbaz 0.0.0 Can't uninstall 'foobarbaz'. No files were found to uninstall.
. There is actually no installation of foobarbaz either in my system or user site packages.
Hi @anntzer! Thanks for filing this issue.
@benoit-pierre Do you by any chance have the time to look into this?
The problem is that when the user site is disabled (as with python -s ...
, and our build isolation), support for the --user
option is disabled by setuptools...
Is there a way around this?
The issue arises also when specifying --user
on the command line:
$ git clone https://github.com/godby-group/idea-public
$ cd idea-public
$ pip install --user -e .
Obtaining file:///home/max/idea-public
Installing build dependencies ... done
Requirement already satisfied: matplotlib>=1.4 in /home/max/.local/lib/python2.7/site-packages (from iDEA==0.1.0) (2.2.3)
Requirement already satisfied: numpy>=1.10 in /home/max/.local/lib/python2.7/site-packages (from iDEA==0.1.0) (1.15.0)
Requirement already satisfied: scipy>=0.17 in /home/max/.local/lib/python2.7/site-packages (from iDEA==0.1.0) (1.1.0)
Requirement already satisfied: cython>=0.22 in /home/max/.local/lib/python2.7/site-packages (from iDEA==0.1.0) (0.28.5)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /home/max/.local/lib/python2.7/site-packages (from matplotlib>=1.4->iDEA==0.1.0) (2.2.0)
Requirement already satisfied: backports.functools-lru-cache in /home/max/.local/lib/python2.7/site-packages (from matplotlib>=1.4->iDEA==0.1.0) (1.5)
Requirement already satisfied: subprocess32 in /home/max/.local/lib/python2.7/site-packages (from matplotlib>=1.4->iDEA==0.1.0) (3.5.2)
Requirement already satisfied: pytz in /home/max/.local/lib/python2.7/site-packages (from matplotlib>=1.4->iDEA==0.1.0) (2018.5)
Requirement already satisfied: six>=1.10 in /usr/local/lib/python2.7/dist-packages (from matplotlib>=1.4->iDEA==0.1.0) (1.11.0)
Requirement already satisfied: python-dateutil>=2.1 in /home/max/.local/lib/python2.7/site-packages (from matplotlib>=1.4->iDEA==0.1.0) (2.7.3)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/max/.local/lib/python2.7/site-packages (from matplotlib>=1.4->iDEA==0.1.0) (1.0.1)
Requirement already satisfied: cycler>=0.10 in /home/max/.local/lib/python2.7/site-packages (from matplotlib>=1.4->iDEA==0.1.0) (0.10.0)
Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from kiwisolver>=1.0.1->matplotlib>=1.4->iDEA==0.1.0) (20.7.0)
Installing collected packages: iDEA
Found existing installation: iDEA 2.3.0
Uninstalling iDEA-2.3.0:
Successfully uninstalled iDEA-2.3.0
Running setup.py develop for iDEA
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/home/max/idea-public/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps --user --prefix=:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --user not recognized
----------------------------------------
Rolling back uninstall of iDEA
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/home/max/idea-public/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps --user --prefix=" failed with error code 1 in /home/max/idea-public/
However, when I run the command that is supposed to fail, it works:
$ /usr/bin/python -c "import setuptools, tokenize;__file__='/home/max/idea-public/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps --user --prefix=
...
Installed /home/max/idea-public
Is there some way around this?
New solution! Nuke your ~/.local/lib/python3.6/
mv ~/.local/lib/python3.6/ ~/.local/lib/python3.6.bak
For the fearless
rm -rf ~/.local/lib/python3.6/
This worked for me, being that i never touch anything globally (pip in PATH is now back to 9.0.1)
There doesn't seem to be any action for pip here, so I'll close this issue.