Çözüldü Python AttributeError hatası

Bu konu çözüldü olarak işaretlenmiştir. Çözülmediğini düşünüyorsanız konuyu rapor edebilirsiniz.

HasHasliRevani

Decapat
Katılım
15 Mart 2021
Mesajlar
37
Daha fazla  
Cinsiyet
Erkek
Kodu çalıştırdığımda aşağıdaki attribute hatasını alıyorum.
Kod:
from anastruct import SystemElements
import math

ss = SystemElements(EA=5000)
ss.add_truss_element(location=[[0, 0], [0, 5]])
ss.add_truss_element(location=[[0, 5], [5, 5]])
ss.add_truss_element(location=[[5, 5], [5, 0]])
ss.add_truss_element(location=[[0, 0], [5, 5]], EA=5000 * math.sqrt(2))

ss.add_support_hinged(node_id=1)
ss.add_support_hinged(node_id=4)

ss.point_load(Fx=10, node_id=2)

ss.solve()
ss.show_structure()
ss.show_reaction_force()
ss.show_axial_force()
ss.show_displacement(factor=10)
Kod:
File "c:\Users\Windows\Desktop\Python\lesson.py", line 10, in <module>
    ss.add_support_hinged(node_id=1)
  File "C:\Users\Windows\AppData\Local\Programs\Python\Python310\lib\site-packages\anastruct\fem\system.py", line 731, in add_support_hinged
    if not isinstance(node_id, collections.Iterable):
AttributeError: module 'collections' has no attribute 'Iterable'
 
Çözüm
collections.Iterable güncel sürümde kaldırılmış, collections.abc.Iterable şeklinde kullanman gerekiyor.
C:\Users\Windows\AppData\Local\Programs\Python\Python310\lib\site-packages\anastruct\fem\system.py bu dosyayı aç ilk satır; import math, re, collections, copy buradan collections sil bir alt satıra geç ve bunu ekle import collections.abc as collections ve kaydet.
collections.Iterable güncel sürümde kaldırılmış, collections.abc.Iterable şeklinde kullanman gerekiyor.
C:\Users\Windows\AppData\Local\Programs\Python\Python310\lib\site-packages\anastruct\fem\system.py bu dosyayı aç ilk satır; import math, re, collections, copy buradan collections sil bir alt satıra geç ve bunu ekle import collections.abc as collections ve kaydet.
 
Çözüm
Dediğinizi yaptım ancak bu sefer farklı bir hata verdi.
Kod:
File "c:\Users\Windows\Desktop\Python\lesson.py", line 13, in <module>
    ss.point_load(Fx=10, node_id=2)
  File "C:\Users\Windows\AppData\Local\Programs\Python\Python310\lib\site-packages\anastruct\fem\system.py", line 949, in point_load
    node_id, Fx, Fy, rotation = args_to_lists(node_id, Fx, Fy, rotation)
  File "C:\Users\Windows\AppData\Local\Programs\Python\Python310\lib\site-packages\anastruct\basic.py", line 38, in args_to_lists  
    if isinstance(arg, collections.Iterable) and not isinstance(arg, str):
AttributeError: module 'collections' has no attribute 'Iterable'
 

Yeni konular

Geri
Yukarı