Solution when module'XXX' has no attribute'XXX' in Python

Solution when module'XXX' has no attribute'XXX' in Python

I got an error when I ran the program.

Traceback (most recent call last):
  File "xxx.py", line 1, in <module>
    import xxx
  File "/Users/tonosamart/xxx.py", line 4, in <module>
    def zzz(arg: xxx.yyy):
AttributeError: module 'yyy' has no attribute 'xxx'

I don't know what it is, but it feels like import has failed?

If there is a program with the same file name as the import specification, the cause is that it goes to read it> < Unlike other languages, it's annoying that file name = class name cannot be used.

I'm addicted to it

Recommended Posts

Solution when module'XXX' has no attribute'XXX' in Python
Attention when os.mkdir in Python
When "No changes detected" is displayed in python3 manage.py makemigrations
Precautions when using pit in Python
Behavior when listing in Python heapq
When using regular expressions in Python
When writing a program in Python
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
When specifying multiple keys in python sort
[Python] Attribute Error:'list' object has no attribute'replace'
Create ScriptableObject in Python when building ADX2
Precautions when pickling a function in python
Revived from "no internet access" in Python
In python + sqlite3 "OperationalError: no such column:"
Dealing with Python error "Attribute Error: module'scipy.misc' has no attribute'imresize'" in deep learning
When looking at memory usage in Python 3
When issuing an INSERT statement in Python, no such column is displayed
ModuleNotFoundError in Python: No module named story
Import Error in Python3: No module named'xxxxx'
What to do when [Errno 2] No such file or directory appears in Python
[Tips] Easy-to-read writing when connecting functions in Python
When codec can't decode byte appears in python
When'DataFrame' object has no attribute'ix' appears in pandas
AttributeError: module'urllib' has no attribute'request' error in urllib.request
"Temporary solution" when pip cannot be updated [Python]
When I try matplotlib in Python, it says'cairo.Context'
ModuleNotFoundError: No module named'_bz2' error in pyenv Python
Precautions when dealing with control structures in Python 2.6
Note on encoding when LANG = C in Python
Character encoding when dealing with files in Python 3
AttributeError: module ‘torch.utils’ has no attribute ‘data’ solution
Split files when writing vim plugin in python
Find the solution of the nth-order equation in python
Import cv2 ModuleNotFoundError: No module named'cv2' in python3
Parallel processing with no deep meaning in Python
[Question] What happens when I use% in python?
Error when trying to install psycopg2 in Python
Behavior when saving python datetime object in MongoDB
Use pydantic when reading environment variables in Python
Django "Query Set, Object has no attribute'foo'" solution
Quadtree in Python --2
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
SendKeys in Python
Meta-analysis in Python
Unittest in python
Discord in Python
DCI in Python
quicksort in python
nCr in python
N-Gram in Python
Programming in python
Plink in Python
Constant in python
Lifegame in Python.
Sqlite in python
StepAIC in Python
N-gram in python
LINE-Bot [0] in Python