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

Unable to install `python-apt` package because of `DistUtilsExtra` module not found #1363

Open
Kocal opened this issue Sep 7, 2019 · 0 comments

Comments

@Kocal
Copy link

commented Sep 7, 2019

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Question

Hi!

Some info before asking the question:

  • Poetry 1.0.0b1
  • Poetry setup a virtualenv with Python 3.7

I'm trying to install python-apt package (for using apt module in Ansible), but I'm facing this error:

➜  System git:(feat/dconf) ✗ poetry add python-apt                       
Using version ^0.7.8 for python-apt

Updating dependencies
Resolving dependencies... (0.1s)


Package operations: 1 install, 0 updates, 0 removals

  - Installing python-apt (0.7.8)

[EnvCommandError]
Command ['/home/kocal/.cache/pypoetry/virtualenvs/system-H90qh8t--py3.7/bin/python', '-m', 'pip', 'install', '--no-deps', 'python-apt==0.7.8'] errored with the following return code 1, and output: 
Collecting python-apt==0.7.8
  Using cached https://files.pythonhosted.org/packages/e5/ff/63bb64a103eda6f13364381e983c0121eeacc337a4421d6005ff7dd76741/python-apt-0.7.8.tar.bz2
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-hcb_ok5s/python-apt/setup.py", line 6, in <module>
        from DistUtilsExtra.command import *
    ModuleNotFoundError: No module named 'DistUtilsExtra'

Indeed, I don't see any distutils library in my virtualenv libraries:

➜  System git:(feat/dconf) ✗ l ~/.cache/pypoetry/virtualenvs/system-H90qh8t--py3.7/lib/python3.7/site-packages
total 88K
drwxr-xr-x 21 kocal kocal 4,0K sept.  7 07:37 .
drwxr-xr-x  3 kocal kocal 4,0K sept.  7 07:36 ..
drwxr-xr-x 18 kocal kocal 4,0K sept.  7 07:36 ansible
drwxr-xr-x  2 kocal kocal 4,0K sept.  7 07:37 ansible-2.7.5.egg-info
-rw-r--r--  1 kocal kocal  126 sept.  7 07:36 easy_install.py
drwxr-xr-x  3 kocal kocal 4,0K sept.  7 07:37 jinja2
drwxr-xr-x  2 kocal kocal 4,0K sept.  7 07:37 Jinja2-2.10.dist-info
drwxr-xr-x  3 kocal kocal 4,0K sept.  7 07:37 jmespath
drwxr-xr-x  2 kocal kocal 4,0K sept.  7 07:37 jmespath-0.9.3.dist-info
drwxr-xr-x  3 kocal kocal 4,0K sept.  7 07:36 markupsafe
drwxr-xr-x  2 kocal kocal 4,0K sept.  7 07:36 MarkupSafe-1.1.0.dist-info
drwxr-xr-x  5 kocal kocal 4,0K sept.  7 07:36 pip
drwxr-xr-x  2 kocal kocal 4,0K sept.  7 07:36 pip-18.1.dist-info
drwxr-xr-x  5 kocal kocal 4,0K sept.  7 07:36 pkg_resources
drwxr-xr-x  2 kocal kocal 4,0K sept.  7 07:36 pkg_resources-0.0.0.dist-info
drwxr-xr-x  4 kocal kocal 4,0K sept.  7 07:37 psutil
drwxr-xr-x  2 kocal kocal 4,0K sept.  7 07:37 psutil-5.6.3.egg-info
drwxr-xr-x  2 kocal kocal 4,0K sept.  7 07:36 __pycache__
drwxr-xr-x  2 kocal kocal 4,0K sept.  7 07:37 PyYAML-5.1.1.egg-info
drwxr-xr-x  6 kocal kocal 4,0K sept.  7 07:36 setuptools
drwxr-xr-x  2 kocal kocal 4,0K sept.  7 07:36 setuptools-40.8.0.dist-info
drwxr-xr-x  3 kocal kocal 4,0K sept.  7 07:37 yaml

But I don't find how to install distutils with Poetry.
It seems that distutils is only installable with system's package manager: sudo apt-get install python3-distutils.

I know that I've already ran this command, so distutils is installed for the global Python interpreter:

➜  System git:(feat/dconf) ✗ l /usr/lib/python3.7/distutils
total 500K
drwxr-xr-x  4 root root 4,0K juin   1 06:27 .
drwxr-xr-x 31 root root  20K juil. 12 06:33 ..
-rw-r--r--  1 root root 8,4K mars  26 08:58 archive_util.py
-rw-r--r--  1 root root  15K mars  26 08:58 bcppcompiler.py
-rw-r--r--  1 root root  47K mars  26 08:58 ccompiler.py
-rw-r--r--  1 root root  18K mars  26 08:58 cmd.py
drwxr-xr-x  3 root root 4,0K juin   1 06:27 command
-rw-r--r--  1 root root 4,8K mars  26 08:58 config.py
-rw-r--r--  1 root root 8,7K mars  26 08:58 core.py
-rw-r--r--  1 root root  17K mars  26 08:58 cygwinccompiler.py
-rw-r--r--  1 root root  139 mars  26 08:58 debug.py
-rw-r--r--  1 root root 3,5K mars  26 08:58 dep_util.py
-rw-r--r--  1 root root 8,2K mars  26 08:58 dir_util.py
-rw-r--r--  1 root root  50K mars  26 08:58 dist.py
-rw-r--r--  1 root root 3,5K mars  26 08:58 errors.py
-rw-r--r--  1 root root  11K mars  26 08:58 extension.py
-rw-r--r--  1 root root  18K mars  26 08:58 fancy_getopt.py
-rw-r--r--  1 root root  13K mars  26 08:58 filelist.py
-rw-r--r--  1 root root 8,0K mars  26 08:58 file_util.py
-rw-r--r--  1 root root  236 avril  3 07:39 __init__.py
-rw-r--r--  1 root root 2,0K mars  26 08:58 log.py
-rw-r--r--  1 root root  30K mars  26 08:58 msvc9compiler.py
-rw-r--r--  1 root root  22K mars  26 08:58 _msvccompiler.py
-rw-r--r--  1 root root  24K mars  26 08:58 msvccompiler.py
drwxr-xr-x  2 root root 4,0K juin   1 06:27 __pycache__
-rw-r--r--  1 root root  295 mars  26 08:58 README
-rw-r--r--  1 root root 7,3K mars  26 08:58 spawn.py
-rw-r--r--  1 root root  22K mars  26 08:58 sysconfig.py
-rw-r--r--  1 root root  13K mars  26 08:58 text_file.py
-rw-r--r--  1 root root  15K mars  26 08:58 unixccompiler.py
-rw-r--r--  1 root root  20K mars  26 08:58 util.py
-rw-r--r--  1 root root 5,1K mars  26 08:58 versionpredicate.py
-rw-r--r--  1 root root  13K avril  3 07:39 version.py

but I can't use it through Poetry.

Did anyone already encountered the issue? 😕

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.