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

Cannot install on Ubuntu 16.04, on both python 2 and 3 #112

Closed
costincaraivan opened this issue May 17, 2018 · 9 comments
Closed

Cannot install on Ubuntu 16.04, on both python 2 and 3 #112

costincaraivan opened this issue May 17, 2018 · 9 comments

Comments

@costincaraivan
Copy link

costincaraivan commented May 17, 2018

> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

I'm using the distro packages for Python and Pip:

 > python3 --version
 Python 3.5.2
 > pip3 --version
 pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)
 > python --version
 Python 2.7.12
 > pip --version
 pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)

I know that pip complains about it not being the latest version, but I think the installation should still work, right?

By complains I mean this:

You are using pip version 8.1.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Anyway:

 > curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python

and

 > curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python3

both end up with this:

Retrieving metadata

Installing version: 0.9.0
 - Getting dependencies
[... output truncated by me...]
Successfully built pyrsistent toml cachecontrol functools32 scandir pastel msgpack-python
Installing collected packages: typing, functools32, jsonschema, six, scandir, pathlib2, first, click, pip-tools, certifi, chardet, idna, urllib3, requests, pylev, pastel, cleo, pyrsistent, virtualenv, cachy, pyparsing, toml, msgpack-python, lockfile, cachecontrol, requests-toolbelt, pkginfo, poetry
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
    prefix=options.prefix_path,
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 732, in install
    **kwargs
  File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 837, 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 1039, 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/share/python-wheels/setuptools-20.7.0-py2.py3-none-any.whl/setuptools/command/install.py", line 38, in finalize_options
    orig.install.finalize_options(self)
  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

😢

(Edit: pip3 install --user poetry worked. I'll leave the issue here and you can close it if you want. I'd say that the default installation instructions should work.)

@digitalresistor
Copy link
Contributor

This same error is happening with the Homebrew'ed version of Python on macOS: #36

@BorePlusPlus
Copy link

I am experiencing the issue on ubuntu 18.04

@ciarancourtney
Copy link

Anything that involves installing packages to system python will require root permission, which is one of the main reasons to avoid installing system packages i.e. sudo pip install my-package-with-buggy-deps

This is a common issue in python and the README should probably address it early on by either:

  1. switching to root user and carry on from there
  2. use sudo where needed

I usually prefer option 2, and from my usage this means:

# to install
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | sudo python3.6

# to setup bash completion
poetry completions bash | sudo tee /etc/bash_completion.d/poetry.bash-completion > /dev/null

@cauebs
Copy link
Contributor

cauebs commented Jul 24, 2018

I believe pip should never be used with root permissions. The current installer is missing a --user flag, but there's already a PR open for that.

@ciarancourtney
Copy link

I wouldn't say never, its a perfectly valid use case for multi-user, system package installs, particularly if the package vendors its dependencies like poetry

@sdispater
Copy link
Member

The Poetry documentation will never recommend installing with sudo since this is a bad practice most of the time. If one wants to install it this way they can and are free do to so.

Nonetheless, Poetry installation is still a pain point and is something that needs to be tackled before Poetry can reach version 1.0.

I want the installer to make Poetry self-sufficient and self-updatable without hitting permissions issues.

The only way to achieve that is to install it in the user directory. For instance, cargo for Rust is installed in the ~/.cargo directory.

@BorePlusPlus
Copy link

The only way to achieve that is to install it in the user directory. For instance, cargo for Rust is installed in the ~/.cargo directory.

In which case should it use base directories as specified by freedesktop?

@sdispater
Copy link
Member

The new installer's behavior fixes this by adopting the behavior that I hinted at here: #112 (comment)

Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants