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

'module' object has no attribute 'session_settings' #1510

Closed
NetSharkDon opened this issue Jan 9, 2017 · 13 comments
Closed

'module' object has no attribute 'session_settings' #1510

NetSharkDon opened this issue Jan 9, 2017 · 13 comments

Comments

@NetSharkDon
Copy link

Hi arvidn
I use libtorrent python binding ,version '1.2.0.0'
when i run python client.py
ERROR
“AttributeError: 'module' object has no attribute 'session_settings'”
HELP ME PLEASE! thanks

@Falcosc
Copy link
Contributor

Falcosc commented Jan 9, 2017

I could confirm that this is currenlty broken.

You could try test.py to check that your compilation does work.

I will fix it.

@NetSharkDon
Copy link
Author

Thank You Very Much
libtorrent 1.1.1 can work
hope for 1.2

@demonskull
Copy link

This problem is still alive with the Deluge torrent daemon.

@arvidn
Copy link
Owner

arvidn commented Dec 26, 2018

session_settings were deprecated a long time ago in favour of settings_pack. I seem to recall it’s still there though, as long as you build with deprecated functions enabled (which is the default)

@arvidn
Copy link
Owner

arvidn commented Dec 26, 2018

Do you have any more details on version of libtorrent and how it was built?

@marcan
Copy link

marcan commented Jan 23, 2019

I'm getting this on upgrade to libtorrent-rasterbar-1.2.0. Deluge fails due to the missing session_settings. It's definitely not there:

Python 2.7.15 (default, Jan 15 2019, 23:07:09) 
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libtorrent
>>> libtorrent.session_settings
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'session_settings'

On another machine still on 1.1.11:

Python 2.7.15 (default, Jan  2 2019, 21:38:32) 
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libtorrent
>>> libtorrent.session_settings
<class 'libtorrent.session_settings'>

This is on Gentoo Linux using the Portage ebuilds.

@marcan
Copy link

marcan commented Jan 23, 2019

The build does enable deprecated functions:

Compiler and linker flags:
  CPPFlags:             -I/usr/include 
  CFlags:               -lpthread -O2 -pipe -march=haswell -fvisibility=hidden
  CXXFlags:             -O2 -pipe -march=haswell -std=c++11 -ftemplate-depth=512 -Wno-format-zero-length -fvisibility=hidden -fvisibility-inlines-hidden
  LDFlags:              -L/usr/lib64 -Wl,-O1 -Wl,--as-needed -fvisibility=hidden -fvisibility-inlines-hidden
  Libs:                  -lboost_system -lpthread  
  Defs:                 -DPACKAGE_NAME=\"libtorrent-rasterbar\" -DPACKAGE_TARNAME=\"libtorrent-rasterbar\" -DPACKAGE_VERSION=\"1.2.0\" -DPACKAGE_STRING=\"libtorrent-rasterbar\ 1.2.0\" -DPACKAGE_BUGREPORT=\"arvid@libtorrent.org\" -DPACKAGE_URL=\"http://www.libtorrent.org\" -DPACKAGE=\"libtorrent-rasterbar\" -DVERSION=\"1.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD=1 -DHAVE_BOOST=/\*\*/ -DHAVE_CXX11=1 -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_CLOCK_GETTIME=1 -DNDEBUG=1 -DTORRENT_USE_INVARIANT_CHECKS=0 -DTORRENT_USE_OPENSSL=1 -DTORRENT_USE_LIBCRYPTO=1 -DHAVE_ICONV=1 -DICONV_CONST= -DBOOST_ASIO_HAS_STD_CHRONO=1 -DBOOST_EXCEPTION_DISABLE=1 -DBOOST_ASIO_ENABLE_CANCELIO=1 -DTORRENT_BUILDING_SHARED=1

Build options:
  deprecated functions: yes
  debug build:          no
  invariant checks:     no
  logging support:      yes

Features:
  encryption support:   yes
  dht support:          yes

These are the ./configure options:

./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --docdir=/usr/share/doc/libtorrent-rasterbar-1.2.0 --htmldir=/usr/share/doc/libtorrent-rasterbar-1.2.0/html --with-sysroot=/ --libdir=/usr/lib64 --disable-debug --disable-export-all --enable-dht --disable-examples --enable-encryption --disable-static --disable-tests --with-libiconv

@arvidn
Copy link
Owner

arvidn commented Jan 23, 2019

session_settings has been deprecated for all of libtorrent-1.1.x, it was removed in libtorrent-1.2.

use settings_pack instead.

@perfect7gentleman
Copy link

:0: UserWarning: You do not have a working installation of the service_identity module: 'No module named service_identity'.  Please install it from <https://pypi.python.org/pypi/service_identity> and make sure all of its dependencies are satisfied.  Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification.  Many valid certificate/hostname mappings may be rejected.
[ERROR   ] 13:41:53 main:248 'module' object has no attribute 'settings_pack'
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/deluge/main.py", line 241, in start_daemon
    Daemon(options, args)
  File "/usr/lib64/python2.7/site-packages/deluge/core/daemon.py", line 147, in __init__
    read_only_config_keys=read_only_config_keys)
  File "/usr/lib64/python2.7/site-packages/deluge/core/core.py", line 106, in __init__
    self.settings = lt.settings_pack()
AttributeError: 'module' object has no attribute 'settings_pack'

@arvidn
Copy link
Owner

arvidn commented Apr 22, 2019

I think the python bindings actually just use a dictionary instead of settings_pack.

See: https://libtorrent.org/python_binding.html

@dylangerdaly
Copy link

dylangerdaly commented May 16, 2019

Could you have just left it in there?

It's not possible to compile Deluge with the latest version of libtorrent.

@arvidn
Copy link
Owner

arvidn commented May 17, 2019

Was settings_pack ever a thing in the python binding? I think it was always just a dict in python.

session_settings have been deprecated since 1.0 iirc

@cas--
Copy link
Contributor

cas-- commented May 26, 2019

@dylangerdaly @perfect7gentleman Deluge 1.3 is definitely not compatible with libtorrent 1.2, I said that 1.0 was the last proper supported libtorrent. Deluge 2.0 will support libtorrent >1.1 and is to be released soon...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants