setup.py build error: Cannot find the version number!

General support for problems installing or using Deluge
Post Reply
cbrace
Member
Member
Posts: 35
Joined: Thu Jan 31, 2019 4:09 pm
Location: Amsterdam

setup.py build error: Cannot find the version number!

Post by cbrace »

Hi all

I have been running deluge v.2.0.3 under FreeBSD. I migrated from python3.6 to python3.7 and something broke my deluge installation.

I go to the source dir to reinstall it:

Code: Select all

~/deluge-2.0.3$ python3.7 setup.py build
Traceback (most recent call last):
  File "setup.py", line 55, in <module>
    _version = get_version(prefix='deluge-', suffix='.dev0')
  File "/usr/home/colin/deluge-2.0.3/version.py", line 71, in get_version
    raise ValueError('Cannot find the version number!')
ValueError: Cannot find the version number!
I tried on a different system with to python3.6, but I get the same error.

Any ideas what is going wrong here?
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: setup.py build error: Cannot find the version number!

Post by mhertz »

Indeed, saw that myself initially, though on a Win10 VM, but regardless.

In the code comments it's stated to be fixed to determine version without git also, but for some reason still doesn't work. Either have git installed, or alternatively bypass the failing get_version() function by running first:

Code: Select all

echo 2.0.3 > RELEASE-VERSION
For latest git develop branch:

Code: Select all

echo 2.0.4.dev23 > RELEASE-VERSION
(Should be run in deluge source top-dir, e.g. containing setup.py etc. Works for windows also i'd just add for people landing here from a google-search possibly)
cbrace
Member
Member
Posts: 35
Joined: Thu Jan 31, 2019 4:09 pm
Location: Amsterdam

Re: setup.py build error: Cannot find the version number!

Post by cbrace »

Many thanks for the quick reply, the build sequence now works.

When I now run "install" I get an error related to pillow:

Code: Select all

setuptools.sandbox.UnpickleableException: RequiredDependencyException('\n\nThe headers or library files could not be found for jpeg,\na required dependency when compiling Pillow from source.\n\nPlease see the install instructions at:\n   https://pillow.readthedocs.io/en/latest/installation.html\n\n')
According to DEPENDS.md, pillow is optional:

Code: Select all

- [Pillow] - Optional: Support for resizing tracker icons.
Would you happen to know how would I either fix this or disable it?

Thanks again
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: setup.py build error: Cannot find the version number!

Post by mhertz »

You're welcome! :)

Btw, just wanted first to correct what I said before(for googler's), that just having git installed isn't enough, as you need a .git dir additionally in the deluge source dir, so instead of downloading a source tarball, then clone the repo instead. I never noticed, because after I installed git in my Win10 VM, then I always used git for getting sources. Anyway, the alternative method of making a RELEASE-VERSION file manually works regardless though. Note, getting deluge 2.0.3 from git is gotten by cloning master branch(add '--branch master' to clone command), as default branch is develop.

About your other issue, then I never install myself, only build, and not on freebsd, but googling your error, states you need libjpeg-dev installed, so try install that first. When checking the link in the error message also, for instructions on installing, then it states that for freebsd 10 and 11, only versions listed, that you need python3 + "sudo pkg install jpeg-turbo tiff webp lcms2 freetype2 openjpeg harfbuzz fribidi" and then finally states "Then see depends/install_raqm_cmake.sh to install libraqm." It also looks like you should end by running "python -m pip install pip" and "python -m pip install Pillow", but I don't know if needed when you install deluge afterwards which also will install pillow. A couple of paragraphs over that, then it states not all libs are needed, and only libjpeg and zlib is, so I don't know if you need all those + I don't even see zlib there, and neither libjpeg-dev, but jpeg-turbo is a variant of libjpeg and I read freebsd already includes zlib. Also, there is listed that these instructions are for source-installs, and before that it states you can install a basic install with, for freebsd ports 'cd /usr/ports/graphics/py-pillow && make install clean', or package: 'pkg install py36-pillow', though I know you use py3.7, so see if they have that. Finally, when looking main error up, then most use linux and state you just need libjpeg-dev, but some say you additionally need zlib1g-dev or zlib-devel.

Sorry for long paragraph and way to verbose probably, but experiment alittle and see if you can figure it out, as said i'm not on freebsd and also never install outside package-manager, as don't like that i.e. untracked files(except under user's bin or .local dir), though i'm spoiled being on arch-linux with pretty much everything available in AUR for installs through package-manager, or for special stuff like I want a certain patch applied additionally, then I make a pkgbuild file for that and install from source that way so every file is fully tracked by the package manager(very much similar system to ports from *bsd.)
Last edited by mhertz on Wed Jan 22, 2020 11:48 pm, edited 2 times in total.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: setup.py build error: Cannot find the version number!

Post by mhertz »

Just wanted to add that there is a py37-pillow package in freebsd ports collection, I saw. Also, as said, I think running 'pkg install libjpeg-turbo' before deluge-install is maybe enough, and if not try whole line posted before.

Lastly and why I post, then i'm thinking that if you don't need pillow anyway, you I guess could delete the line with pillow in setup.py, or, not sure at all, but maybe delete the line with pillow from requirements.txt and run 'python -m pip install -r requirements.txt'. (maybe need adjusting the python command to python3 or python37 or whatever is the correct name for installed py3 on freebsd, or just avoid the python part and directly run pip, pip3 or pip37 etc)

Good luck :)

Edit: During googling this, I found a post by you where you stated having alot of torrents still in v1.3.x as not compatible with 2.0.x, so just in case you hadn't seen already, then here's a little info about fixing that: viewtopic.php?f=7&t=55508&p=230868#p230598
cbrace
Member
Member
Posts: 35
Joined: Thu Jan 31, 2019 4:09 pm
Location: Amsterdam

Re: setup.py build error: Cannot find the version number!

Post by cbrace »

@mherz, thanks once again for your helpful feedback.

Installing py37-pillow solved that particular problem.

But I still can't get it working. Now deluge can't find libtorrent:

Code: Select all

$ deluged & 
[1] 29933
colin@venus:~$ Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/deluge-2.0.3-py3.7.egg/deluge/_libtorrent.py", line 23, in <module>
    import deluge.libtorrent as lt
ModuleNotFoundError: No module named 'deluge.libtorrent'
It should be there though:

Code: Select all

$ pkg info|grep torrent
libtorrent-0.13.8              BitTorrent Library written in C++
libtorrent-rasterbar-1.2.3     C++ library implementing a BitTorrent client
Like you I would MUCH prefer not to work this way, and normally I don't; I work only binary packages. But for some reason deluge is still at 1.3.15 in the ports system (https://www.freshports.org/net-p2p/deluge/), as it is in debian.

For the time being I have migrated my deluge v2 installation to a machine running Linux Mint, where I can install v2 via the Ubuntu PPA.

I'm kinda perplexed about the problems under FreeBSD though. In August I got it running fairly easily, just a matter of installing the dependencies manually, and that was that. <shrug>

I'll try the v1.3 torrents conversion routine, thanks for the pointer.
cbrace
Member
Member
Posts: 35
Joined: Thu Jan 31, 2019 4:09 pm
Location: Amsterdam

Re: setup.py build error: Cannot find the version number!

Post by cbrace »

The above-mentioned error occurs during the build process:

Code: Select all

[...]
running build_py
copying deluge/plugins/Extractor-0.7-py3.7.egg -> build/lib/deluge/plugins
copying deluge/plugins/Blocklist-1.4-py3.7.egg -> build/lib/deluge/plugins
copying deluge/plugins/AutoAdd-1.8-py3.7.egg -> build/lib/deluge/plugins
copying deluge/plugins/Scheduler-0.3-py3.7.egg -> build/lib/deluge/plugins
copying deluge/plugins/Execute-1.3-py3.7.egg -> build/lib/deluge/plugins
copying deluge/plugins/Notifications-0.3-py3.7.egg -> build/lib/deluge/plugins
copying deluge/plugins/Label-0.3-py3.7.egg -> build/lib/deluge/plugins
copying deluge/plugins/WebUi-0.2-py3.7.egg -> build/lib/deluge/plugins
copying deluge/plugins/Toggle-0.4-py3.7.egg -> build/lib/deluge/plugins
copying deluge/plugins/Stats-0.4-py3.7.egg -> build/lib/deluge/plugins
copying deluge/ui/web/js/deluge-all-debug.js -> build/lib/deluge/ui/web/js
copying deluge/ui/web/js/gettext.js -> build/lib/deluge/ui/web/js
copying deluge/ui/web/js/extjs/ext-extensions-debug.js -> build/lib/deluge/ui/web/js/extjs
Warning: libtorrent (libtorrent-rasterbar) not found: No module named 'libtorrent'
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: setup.py build error: Cannot find the version number!

Post by mhertz »

Unfortunetly I don't know how to fix this on FreeBSD, sorry.

I found these related freebsd bug reports, where the second also is referenced in the first:

https://github.com/arvidn/libtorrent/issues/4204


https://bugs.freebsd.org/bugzilla/show_ ... ?id=242797

You properly need py-libtorrent-rasterbar port, but the bug reports above unfortunetly also states issues there, though contains patches to test also.

I hope you find a solution, good luck :)
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: setup.py build error: Cannot find the version number!

Post by mhertz »

Just quickly wanted to add that from reading again the threads from my previous post, and looking up how apply patches for ports, then I believe you need install py-libtorrent-rasterbar with se-m patch that can be downloaded from second link in previous post.

Applying patches to ports on freebsd:
Patch files are stored in PATCHDIR, usually files/, from where they will be automatically applied. All patches must be relative to WRKSRC. Typically WRKSRC is a subdirectory of WRKDIR, the directory where the distfile is extracted. Use make -V WRKSRC to see the actual path
Source: https://www.freebsd.org/doc/en_US.ISO88 ... patch.html
Post Reply