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

distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base #26

Open
kepi opened this issue Sep 18, 2018 · 2 comments

Comments

@kepi
Copy link

kepi commented Sep 18, 2018

Hello,

I tried to create simple requirements.txt file where there is only one line matrix_client.

~/tmpfs/test  
❯ cat requirements.txt 
matrix_client

~/tmpfs/test  
❯ pundle
Install some packages
try <pip._vendor.distlib.locators.SimpleScrapingLocator object at 0x7fe1c9230610> for matrix_client
Collecting matrix-client==0.3.2 from https://files.pythonhosted.org/packages/6b/0b/65dc841fd3d14e7ebc6081bbfce23365a6b2f68cc6ae2ae2d1d7d59570cd/matrix_client-0.3.2-py2.py3-none-any.whl
  Using cached https://files.pythonhosted.org/packages/6b/0b/65dc841fd3d14e7ebc6081bbfce23365a6b2f68cc6ae2ae2d1d7d59570cd/matrix_client-0.3.2-py2.py3-none-any.whl
Installing collected packages: matrix-client
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 360, in run
    prefix=options.prefix_path,
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 247, in move_wheel_files
    prefix=prefix,
  File "/usr/lib/python2.7/dist-packages/pip/locations.py", line 153, in distutils_scheme
    i.finalize_options()
  File "/usr/lib/python2.7/distutils/command/install.py", line 289, in finalize_options
    raise DistutilsOptionError("can't combine user with prefix, "
DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/kepi/.local/lib/python2.7/site-packages/pundle.py", line 1250, in <module>
    CmdRegister.main()
  File "/home/kepi/.local/lib/python2.7/site-packages/pundle.py", line 1025, in main
    cls.commands[alias]()
  File "/home/kepi/.local/lib/python2.7/site-packages/pundle.py", line 1031, in cmd_install
    install_all(**create_parser_or_exit())
  File "/home/kepi/.local/lib/python2.7/site-packages/pundle.py", line 908, in install_all
    suite.install()
  File "/home/kepi/.local/lib/python2.7/site-packages/pundle.py", line 467, in install
    state.reveal_requirements(self, install=install)
  File "/home/kepi/.local/lib/python2.7/site-packages/pundle.py", line 327, in reveal_requirements
    dist = self.check_installed_version(suite, install=install)
  File "/home/kepi/.local/lib/python2.7/site-packages/pundle.py", line 299, in check_installed_version
    self.frozen = dist.version
AttributeError: 'NoneType' object has no attribute 'version'

System is Debian Linux (Unstable), python is installed from distribution. Same problem is with python3.

It is probably some problem with distutils configuration or something like that. I tried to search if I had some user configuration changes but I didn't find any.

I found this: https://stackoverflow.com/questions/4495120/combine-user-with-prefix-error-with-setup-py-install but creating that config file didn't help and more, I'm not sure what will be other sideeffects.

@Deepwalker
Copy link
Owner

pundle uses --target pip feature to install package to dedicated path. So somewhere in your system --user option is configured. You need to turn it off. Also you can give a try to pyenv. I personally do not like system python distributions, especially from debian guys.

@codecakes
Copy link

python3 -m pip install --system -r requirements.txt -t $(pwd)

sac added a commit to sac/gstatus that referenced this issue Aug 10, 2020
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

3 participants