Skip to contentSkip to conversation

Pip dependency problem with b4

DISCUSSION James Bottomley 3 participants 6 messages Mar 23, 2020

lore
Share & tools
lore
#0 lore raw

This is on a vanilla ubuntu 19.10 system with a fresh install. After doing

apt-get install python-pip
pip-install b4

I get this

jejb@amdmilan1:~/git/linux-build$ b4 --help
Traceback (most recent call last):
  File "/home/jejb/.local/bin/b4", line 6, in <module>
    from b4.command import cmd
  File "/home/jejb/.local/lib/python2.7/site-packages/b4/__init__.py",
line 11, in <module>
    import email.policy
ImportError: No module named policy

Which looks like a missing dependency pip should have installed.

James

#1 lore raw
Quoted 6 lines · James Bottomley

This is on a vanilla ubuntu 19.10 system with a fresh install. After doing

apt-get install python-pip
pip-install b4

Quoted 7 lines

I get this

jejb@amdmilan1:~/git/linux-build$ b4 --help
Traceback (most recent call last):
  File "/home/jejb/.local/bin/b4", line 6, in <module>
    from b4.command import cmd
  File "/home/jejb/.local/lib/python2.7/site-packages/b4/__init__.py",
                                ^^^^^^^^^

Sorry, please use python 3.

-K

#2 lore raw
Quoted 17 lines · Konstantin Ryabitsev
Quoted 7 lines · James Bottomley

This is on a vanilla ubuntu 19.10 system with a fresh install. After
doing

apt-get install python-pip
pip-install b4

Quoted 8 lines

I get this

jejb@amdmilan1:~/git/linux-build$ b4 --help
Traceback (most recent call last):
  File "/home/jejb/.local/bin/b4", line 6, in <module>
    from b4.command import cmd
  File "/home/jejb/.local/lib/python2.7/site-
packages/b4/__init__.py",
Quoted 2 lines
                                ^^^^^^^^^

Sorry, please use python 3.

I can fix it manually, but pip should have said ... it does for most other packages.

james

#3 lore raw
Quoted 7 lines · James Bottomley
Quoted 7 lines
Quoted 6 lines
jejb@amdmilan1:~/git/linux-build$ b4 --help
Traceback (most recent call last):
  File "/home/jejb/.local/bin/b4", line 6, in <module>
    from b4.command import cmd
  File "/home/jejb/.local/lib/python2.7/site-
packages/b4/__init__.py",
Quoted 5 lines
Quoted 2 lines
                                ^^^^^^^^^

Sorry, please use python 3.

I can fix it manually, but pip should have said ... it does for most other packages.

I've added python_requires='>=3.6' to the proper place, so 0.3.4 will do the right thing.

Best regards,
-K

#4 lore raw
Quoted 8 lines · Konstantin Ryabitsev
Quoted 7 lines · James Bottomley
Quoted 7 lines
Quoted 6 lines
jejb@amdmilan1:~/git/linux-build$ b4 --help
Traceback (most recent call last):
  File "/home/jejb/.local/bin/b4", line 6, in <module>
    from b4.command import cmd
  File "/home/jejb/.local/lib/python2.7/site-
packages/b4/__init__.py",
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
                                ^^^^^^^^^

Sorry, please use python 3.

I can fix it manually, but pip should have said ... it does for most other packages.

I've added python_requires='>=3.6' to the proper place, so 0.3.4 will do the right thing.

Unrelated, but when using pip to install b4 into a virtual env directly from git (not via some pip cloud) it blows up as setup.py imports b4, and b4 imports all kinds of stuff..

Jason

#5 lore raw
Quoted 6 lines · Jason Gunthorpe
Quoted 2 lines

I've added python_requires='>=3.6' to the proper place, so 0.3.4 will do the right thing.

Unrelated, but when using pip to install b4 into a virtual env directly from git (not via some pip cloud) it blows up as setup.py imports b4, and b4 imports all kinds of stuff..

Well, this page is a hoot:
https://packaging.python.org/guides/single-sourcing-package-version/

Anyway, I switched to using to what is hopefully the least terrible way of doing it.

-K