The Deck class isn't being found because it isn't in your current name space. To use it, you need to refer to it using the module name. You'll have the same problem with the test2 function. Change war.py to look like this:

import deck

d = deck.Deck()
deck.test2()
d.test()

Another error you will encounter is that your Deck.test method doesn't expect any parameters, but needs to. Add "self" (without quotes) between the parentheses.

Answer from PTBNL on Stack Overflow
🌐
Containersolutions
containersolutions.github.io › runbooks › posts › python › module-has-no-attribute
Module has no attribute – Runbooks - GitHub Pages
Given the above code a call to foo.bar() within main.py would result in an error about the module ‘foo’ not having the attribute ‘bar’. This is because we have only made the module accessible and not it’s class foo. So to call it we could instead do foo.foo.bar() with the first foo being the module name and the second being the class name. If we change the import from step 1 to instead be from <modulename> import <classname> this will make the class foo directly accessible, eg:
Discussions

Import Client Module Error - AttributeError: ‘module’ object has no attribute - Talk Python
Hello everyon I was wondering if someone could help me. With the new folder structure I cannot seem to import the module into the sub forms. My structure is as follows App -> Main Form -> Sub Form 1| Sub Form2 | Subform X | navigation module I have tried to import the module in the sub form ... More on anvil.works
🌐 anvil.works
1
1
January 2, 2020
package - Python error: AttributeError: 'module' object has no attribute - Stack Overflow
I'm totally new to Python and I know this question was asked many times, but unfortunately it seems that my situation is a bit different... I have created a package (or so I think). The catalog tre... More on stackoverflow.com
🌐 stackoverflow.com
python - module has no attribute - Stack Overflow
This is a completely unrelated ... file has the same name as the other module you want to import. The problem is that every Python source code file defines a module, whether or not you intend for it to be imported. The modules defined by source code files can, therefore, attempt to import themselves. 2023-04-28T20:03:44.1Z+00:00 ... The canonical for this problem is Importing a library from (or near) a script with the same name raises "AttributeError: module has ... More on stackoverflow.com
🌐 stackoverflow.com
python - AttributeError: 'module' object has no attribute V2 (custom module) - Stack Overflow
Traceback (most recent call last): ... 'module' object has no attribute 'V2' ... V2.py contains multiple classes, among them Cached_V2. What's going on? Why isn't the object visible as expected? ... In your A.py, use from Hasher import V2 Basically, when you are just importing 'Hasher' only the init.py file gets loaded. Reference: Python error: ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Net Informations
net-informations.com › python › err › attr.htm
Module object has no attribute error: Python
Attribute errors in Python are generally raised when you try to access or call an attribute that a particular object type doesn't possess. It's simply because there is no attribute with the name you called, for that Object. This means that you got the error when the "module" does not contain ...
🌐
Bobby Hadz
bobbyhadz.com › blog › python-attributeerror-module-has-no-attribute
AttributeError: module 'X' has no attribute 'Y' in Python | bobbyhadz
April 8, 2024 - This means that you are either trying to access an attribute that is not present on the module, or you have an incorrect import statement. Consider the following example. We have a module called another_file.py that has an Employee class.
Find elsewhere
🌐
Quora
quora.com › What-is-the-reason-for-the-AttributeError-module-object-has-no-attribute-check_output-in-Python
What is the reason for the AttributeError: 'module' object has no attribute 'check_output', in Python? - Quora
Answer (1 of 3): Without seeing code it is difficult to come up with a definitive answer, but I think the problem is that the code that you are importing is something similar to this : You have a module called [code ]fluff[/code] and inside that module you have a class called [code ]fluff;[/code...
🌐
Medium
medium.com › @kasata › understanding-and-fixing-pythons-attributeerror-module-object-has-no-attribute-x-cb25b49311ab
Understanding and Fixing Python’s AttributeError: 'module' object has no attribute 'X' | by KASATA - TechVoyager | Medium
May 25, 2024 - ``` Rename your custom module to avoid overshadowing standard library modules. The following steps can help you troubleshoot and fix the error: 1. Verify Module Content Inspect the module to ensure it contains the attribute you want to use.
🌐
Codingdeeply
codingdeeply.com › home › troubleshooting: python module has no attribute – tips and solutions
Troubleshooting: Python Module Has No Attribute - Tips and Solutions
February 23, 2024 - If two modules depend on each other, ... tries to access its attribute. Using the wrong import statement to import a module or attribute can cause the “Python Module Has No Attribute” error....
🌐
Reddit
reddit.com › r/learnpython › "module ... has no attribute ..."
r/learnpython on Reddit: "Module ... has no attribute ..."
March 26, 2023 -

I'm writing python in vscode. I have 2 py files (main and converters).

Converters:

def lbstokg(weight):
return weight*0.45

def kgtolbs(weight):
return weight / 0.45

Main:

import converters
print(converters.lbstokg(10))

Error when running: AttributeError: module 'converters' has no attribute 'lbstokg'

Why? It's in the same folder, it knows that the module is there because it's in the dropdown list after typing converters.. The code works in pycharm but doesn't in vscode.

🌐
Itsourcecode
itsourcecode.com › home › attributeerror module has no attribute
Attributeerror module has no attribute [SOLVED]
April 3, 2023 - math” and also has a local module with the same name “math,” there will be a conflict between the two modules. Having an incorrect import statement. It refers to a situation where you have mistakenly imported a module into your Python script or program. To see what you have imported and the available attributes and methods of the module, you can use the dir() function.
🌐
Python Clear
pythonclear.com › home › errors › 5 ways to solve python module has no attribute
5 Ways To Solve Python Module Has No Attribute - Python Clear
June 21, 2023 - # Module A from module_b import ... has no attribute 'bar' Namespace conflicts: It’s possible that you have inadvertently used the same name for an attribute or function in your code, conflicting with the attribute you are attempting to access from the module. Python allows you to overwrite attribute names within your code, so carefully inspect your code for any naming conflicts. To avoid conflicts, consider renaming your attribute or function. ... # Custom module with ...
🌐
GitHub
github.com › python › mypy › issues › 7423
Incorrect "Module ... has no attribute" · Issue #7423 · python/mypy
August 30, 2019 - planner/web.py:1: error: Module 'planner.scheduling' has no attribute 'book_campaign' planner/web.py:1: error: Module 'planner.scheduling' has no attribute 'cancel_campaign' planner/web.py:1: error: Module 'planner.scheduling' has no attribute 'reserve_campaign'
Author   be9
🌐
Reddit
reddit.com › r/learnpython › [deleted by user]
"Module has no attribute" issue : r/learnpython
November 30, 2023 - PS C:\Users\warm family\Documents\Assembly AI _ new project> & "C:/Users/warm family/AppData/Local/Programs/Python/Python311/python.exe" "c:/Users/warm family/Documents/Assembly AI _ new project/assem290sa.py" Traceback (most recent call last): File "c:\Users\warm family\Documents\Assembly AI _ new project\assem290sa.py", line 3, in <module> aai.settings.api_key = "149a40e8757348e991cc4958d59318a5" ^^^^^^^^^^^^ AttributeError: module 'assemblyai' has no attribute 'settings' PS C:\Users\warm family\Documents\Assembly AI _ new project> I installed already assembly with CMD command: pip install -U assemblyai ·