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

cargo-kani setup fails due to python distutils error on Ubuntu 18.04.2 #1184

Closed
JustusAdam opened this issue May 10, 2022 · 5 comments · Fixed by #1231
Closed

cargo-kani setup fails due to python distutils error on Ubuntu 18.04.2 #1184

JustusAdam opened this issue May 10, 2022 · 5 comments · Fixed by #1231
Assignees
Labels
[C] Bug This is a bug. Something isn't working.

Comments

@JustusAdam
Copy link
Contributor

JustusAdam commented May 10, 2022

I ran cargo-kani setup after successfully installing cargo +nightly install --locked kani-verifier and got the following error:

Installing collected packages: MarkupSafe, jinja2, setuptools, voluptuous, cbmc-viewer
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 356, in run
    requirement_set.install(
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 780, in install
    requirement.install(
  File "/usr/lib/python3/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/python3/dist-packages/pip/req/req_install.py", line 1057, in move_wheel_files
    move_wheel_files(
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 245, in move_wheel_files
    scheme = distutils_scheme(
  File "/usr/lib/python3/dist-packages/pip/locations.py", line 153, in distutils_scheme
    i.finalize_options()
  File "/usr/lib/python3.8/distutils/command/install.py", line 274, in finalize_options
    raise DistutilsOptionError("can't combine user with prefix, "
distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base

According to the interwebs this is because something is causing pip so perform a --user install, which does not combine with --target. I couldn't quite figure out if this (the user install) is an option that is set by Ubuntu and if I could disable it.

Apologies if you think this is not a kani issue.

Kani version: 0.1.0

@JustusAdam JustusAdam added the [C] Bug This is a bug. Something isn't working. label May 10, 2022
@tedinski
Copy link
Contributor

I'm going to guess it's a platform/os issue.

I notice /usr/lib/python3 and /usr/lib/python3.8. Could this be multiple versions of python conflicting? Maybe something related to how you got 3.8 installed on 18.04? (e.g. maybe that install package tries to force --user to avoid installing anything globally and conflicting with global python?)

@tedinski
Copy link
Contributor

FWIW, the next release of Kani should use a newer version of viewer which relaxes python back to 3.6, and so it would work without needing a newer python package. If you can wait a week for that next release, it's probably the simplest fix!

(That said, if there's a way we can work around python packages forcing --user so we can use --prefix... we'd happily incorporate that too...)

@JustusAdam
Copy link
Contributor Author

If you can wait a week for that next release, it's probably the simplest fix!

I'm currently trying the source install instead to deal with this. Btw during the source install it worked fine.

I'm not really sure how it could be because of the different pythons, but that said I did have to revert it for the source install so it might make sense to just wait it out for the next release and see if it fixes itself.

@zhassan-aws
Copy link
Contributor

This seems to be a known issue on some OS: https://stackoverflow.com/questions/4495120/combine-user-with-prefix-error-with-setup-py-install
A suggested workaround is provided in the SO thread.

@zhassan-aws
Copy link
Contributor

I reproduced the same error on a fresh 18.04 AWS instance with Kani version 0.2.

@tedinski tedinski moved this to In Progress in Kani v0.3 May 31, 2022
Repository owner moved this from In Progress to Done in Kani v0.3 May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Bug This is a bug. Something isn't working.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants