You are not logged in.

#1 2017-08-06 13:54:00

kryptxy
Member
Registered: 2017-06-11
Posts: 28

[Solved] pkg_resources.DistributionNotFound error

I'm trying to create an AUR package.
Here:

# Maintainer: kryptxy <kryptxy@protonmail.com>

pkgname=torrench
pkgver=1.0.1.20160806
pkgrel=1
pkgdesc="Command-line torrent search tool"
arch=('any')
url="https://github.com/kryptxy/torrench"
license=('GPL')
depends=("python" "python-beautifulsoup4" "python-lxml" "python-requests" "python-termcolor" "python-tabulate")
makedepends=("python-setuptools")
provides=("torrench")
conflicts=("torrench")
source=('git+https://github.com/kryptxy/torrench.git')
md5sums=('SKIP')

build() {
	cd "$pkgname"
	python setup.py build	
}

package() {
	cd "$srcdir/$pkgname"
	python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
}

The package builds and installs successfully. But when I try to run it, I get following error:

$ torrench "ubuntu"
Traceback (most recent call last):
  File "/usr/bin/torrench", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3049, in <module>
    @_call_aside
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3033, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3062, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 658, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 972, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 858, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'bs4' distribution was not found and is required by torrench

I checked, bs4 is installed in the system. But I'm still getting this error. [I am able to import bs4 from python interactive shell]

Project link: https://github.com/kryptxy/torrench

Help please.

Last edited by kryptxy (2017-08-06 20:28:21)

Offline

#2 2017-08-06 15:37:41

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] pkg_resources.DistributionNotFound error

That's not the name of the python package. It's called beautifulsoup4, and that is what setuptools will look for when it attempts to check runtime dependencies.
The import path (bs4) is completely irrelevant.

I'm guessing there is a bad install_requires in that setup.py


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2017-08-06 18:44:05

kryptxy
Member
Registered: 2017-06-11
Posts: 28

Re: [Solved] pkg_resources.DistributionNotFound error

That was the issue. Changing bs4 to beautifulsoup4 fixed it smile Thanks.

Offline

#4 2017-08-06 19:09:11

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] pkg_resources.DistributionNotFound error

Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2017-08-06 20:17:25

kryptxy
Member
Registered: 2017-06-11
Posts: 28

Re: [Solved] pkg_resources.DistributionNotFound error

jasonwryan wrote:

Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.

Unable to prepend - Title box reaches its max word length

Offline

#6 2017-08-06 20:20:23

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] pkg_resources.DistributionNotFound error

You've hit the max field length, you need to delete a few characters. I'd suggest...

[SOLVED] pkg_resources.DistributionNotFound error


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB