Skip to content

virtmanager: Fix python import error #26375

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

Merged
merged 1 commit into from
Jun 6, 2017

Conversation

midchildan
Copy link
Member

Motivation for this change

PYTHONPATH was not set when running virt-manager, resulting in the following error:

$ virt-manager
Traceback (most recent call last):
  File "/nix/store/2iiz3nfs5x9wbprf0mfiahir0hzibbgf-virt-manager-1.4.1/share/virt-manager/virt-manager", line 29, in <module>
    import gi
ImportError: No module named gi
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@mention-bot
Copy link

@midchildan, thanks for your PR! By analyzing the history of the files in this pull request, we identified @qknight, @fpletz and @offlinehacker to be potential reviewers.

@FRidh
Copy link
Member

FRidh commented Jun 4, 2017

Likely caused by aa86d9f.

By including the current $PYTHONPATH, you will also include the site-packages of packages that are only required during build-time. Whether that is relevant in this case I do not know.

@midchildan
Copy link
Member Author

None of the dependencies specified by nativeBuildInputs seem to provide a site-packages directory, so I guess it shouldn't be a problem for this package. Should I explicitly specify the packages I want to put in PYTHONPATH ?

@FRidh
Copy link
Member

FRidh commented Jun 5, 2017

@midchildan then it is alright, at least now. One more thing, can you check whether the programs works properly if you use --set instead of --prefix.

@midchildan
Copy link
Member Author

@FRidh I just tried, but it doesn't work when I use --set . When I use --prefix , I get a really long PYTHONPATH . But when I use --set , I only get PYTHONPATH=":" .

@FRidh
Copy link
Member

FRidh commented Jun 5, 2017

@midchildan ah, right, that's because --set needs to be used without a separator.
https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/make-wrapper.sh#L7

@midchildan
Copy link
Member Author

Oops, sorry. I tried again, and virt-manager seems to be working fine now. I do get a permission error when trying to boot a VM using a livecd, but I guess I got some configuration wrong.

@FRidh
Copy link
Member

FRidh commented Jun 5, 2017

If you like to test further, please do. Otherwise, I like to merge the --set patch.

@midchildan
Copy link
Member Author

I'm okay with it.

@fpletz
Copy link
Member

fpletz commented Jun 6, 2017

Tested. Thanks!

@fpletz fpletz merged commit ddff443 into NixOS:master Jun 6, 2017
@midchildan midchildan deleted the fix-virt-manager branch June 6, 2017 05:30
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

Successfully merging this pull request may close these issues.

None yet

4 participants