Skip to content

manual: "python modules using pip in a virtualenv" example don't work #43737

@davidak

Description

@davidak

Issue description

[davidak@nixos:~/test]$ nix-shell 
these paths will be fetched (10.58 MiB download, 52.88 MiB unpacked):
  /nix/store/51zrpaysgqxr2m40h6qg4jhibzgpw09j-libxslt-1.1.32-py
  /nix/store/85nxa2jwgj3wqzyvc3wy8172fpml78qj-python-2.7.15
  /nix/store/8rf3qalbykr0y4l6wnmjgm9crgb82w52-python2.7-pip-9.0.1
  /nix/store/c8xna3dajanqz84jphwg08nca18cmfx0-libzip-1.3.0-dev
  /nix/store/ddcp1awgbcnkbg4crkqv6pqmawqa61vj-libzip-1.3.0
  /nix/store/gjqbxhyjsvn1j0z3m3ld7l5v6kczib2c-python-recursive-pth-loader-1.0
  /nix/store/m9d4pfi6kag8mc0i1zxl1zzsnwzc6x8y-python2.7-virtualenv-15.1.0
copying path '/nix/store/gjqbxhyjsvn1j0z3m3ld7l5v6kczib2c-python-recursive-pth-loader-1.0' from 'https://cache.nixos.org'...
copying path '/nix/store/51zrpaysgqxr2m40h6qg4jhibzgpw09j-libxslt-1.1.32-py' from 'https://cache.nixos.org'...
copying path '/nix/store/85nxa2jwgj3wqzyvc3wy8172fpml78qj-python-2.7.15' from 'https://cache.nixos.org'...
copying path '/nix/store/8rf3qalbykr0y4l6wnmjgm9crgb82w52-python2.7-pip-9.0.1' from 'https://cache.nixos.org'...
copying path '/nix/store/ddcp1awgbcnkbg4crkqv6pqmawqa61vj-libzip-1.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/m9d4pfi6kag8mc0i1zxl1zzsnwzc6x8y-python2.7-virtualenv-15.1.0' from 'https://cache.nixos.org'...
copying path '/nix/store/c8xna3dajanqz84jphwg08nca18cmfx0-libzip-1.3.0-dev' from 'https://cache.nixos.org'...
New python executable in /home/davidak/test/venv/bin/python2.7
Also creating executable in /home/davidak/test/venv/bin/python
Installing pip, wheel...done.
Traceback (most recent call last):
  File "/home/davidak/test/venv/bin/pip", line 7, in <module>
    from pip._internal import main
ImportError: No module named _internal

Same with Python 3:

...
Traceback (most recent call last):
  File "/home/davidak/code/mein/venv/bin/pip", line 7, in <module>
    from pip._internal import main
ImportError: No module named 'pip._internal'

related to #26876 #33713 #39558

cc @domenkozar

Steps to reproduce

  1. copy example into default.nix as is https://nixos.org/nixpkgs/manual/#how-to-consume-python-modules-using-pip-in-a-virtualenv-like-i-am-used-to-on-other-operating-systems
  2. create requirements.txt with "requests" as content
  3. nix-shell

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.14.55, NixOS, 18.03.132865.411cc559c05 (Impala)
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 2.0.4
  • channels(root): "nixos-18.03, nixos-hardware, nixos-unstable-18.09pre143771.a8c71037e04"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: pythonPython is a high-level, general-purpose programming language.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions