question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python API no attribute Session

See original GitHub issue

Following the querybind example I impoort the BaseXClient and then need to connect the session

# create session session = BaseXClient.Session('localhost', 1984, 'admin', 'admin')

When I attempt to connect the session error returned that BaseXClient has no attribute Session

session = BaseXClient.Session(‘localhost’, 1984, ‘admin’, ‘admin’)

AttributeErrorTraceback (most recent call last)
<ipython-input-6-272a3e1022b0> in <module>()
----> 1 session = BaseXClient.Session('localhost', 1984, 'admin', 'admin')

AttributeError: module 'BaseXClient' has no attribute 'Session'

and system info included

Sayth@renshaw-laptop ~
λ python
Python 3.5.2 |Anaconda 4.1.1 (64-bit)| (default, Jul  5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import BaseXClient
>>> session = BaseXClient.Session('localhost', 1984, 'admin', 'admin')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'BaseXClient' has no attribute 'Session'
>>>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
jacobborisovcommented, Nov 3, 2016

@MortalCatalyst try to use following import statement:

from BaseXClient import BaseXClient

2reactions
jtaubercommented, Nov 27, 2017

Part of the confusion is if you pip install BaseXClient you have a package called BaseXClient with a module inside it called BaseXClient. If you’re inside the source tree import BaseXClient is importing the module (in the file BaseXClient.py) not the package.

One way to solve the problem would be to move BaseXClient.py into a BaseXClient directory (with a __init__.py in it to make it a package. That way, from the directory with the examples, import BaseXClient would import the package, just like it does when pip install.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'API' object has no attribute 'session'
Using Version: 0.117.0 of instabot. Already being logged in I run: from instabot import Bot insta = Bot() insta.upload_photo(photo_path,caption ...
Read more >
AttributeError: module 'requests.api' has no attribute 'Session'
AttributeError: module 'requests. api' has no attribute 'Session'" · Issue #46 · python-cas/python-cas · GitHub.
Read more >
Module 'TensorFlow' Has No Attribute 'session' - Python Guides
Reason: The possible reason for this error is that the tf. session() attribute is not available in Tensorflow's latest version (TensorFlow2.
Read more >
TensorFlow 2.0 has no attribute session - RoseIndia.Net
Today we will see the main reason behind the "TensorFlow 2.0 has no attribute session" error in TensorFlow and also see what can...
Read more >
SessionAttr.create - Python API - Zato
Creates a new session attribute, optionally encrypting it before it is ... to set expiry for an attribute, upon reaching of which the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found