AttributeError: module 'networkx' has no attribute 'from_agraph'? - python

I'm data analysis using GoaTools, I installed all the sufficient packages, its shows error. Not able to figure it out. Help is needed.
Using Python 3.7.6
python plot_go_term.py --term=GO:0005737 --gml
go-basic.obo: fmt(1.2) rel(2020-06-01) 47,233 GO Terms
GO:0005737 level-02 depth-02 cytoplasm [cellular_component]
all parents: {'GO:0005575', 'GO:0110165'}
all children: {'GO:0016528', 'GO:0099631', 'GO:0106037', 'GO:0045495', 'GO:0060293', 'GO:0032838', 'GO:0120111', 'GO:0097575', 'GO:1902716', 'GO:0061846', 'GO:1990753', 'GO:1904115', 'GO:0099568', 'GO:0051285', 'GO:0097014', 'GO:0098831', 'GO:0032839', 'GO:0099738', 'GO:0045179', 'GO:0061803', 'GO:0061802', 'GO:0045180', 'GO:1990917', 'GO:0005938', 'GO:0031097', 'GO:0098834', 'GO:1904269'}
Traceback (most recent call last):
File "plot_go_term.py", line 59, in <module>
draw_children=opts.draw_children)
File "/home/cent/anaconda3/lib/python3.7/site-packages/goatools/obo_parser.py", line 594, in draw_lineage
obj = nx.from_agraph(grph) if engine == "pygraphviz" else nx.from_pydot(grph)
AttributeError: module 'networkx' has no attribute 'from_agraph'

Related

AttributeError: 'TApplicationException' object has no attribute 'result'

I've got this issue while running circus-serve locally and calling the service with circus-script.
Tried different versions of circus and reinstalling dependant packages but nothing worked.
Traceback (most recent call last):
File "src/gevent/greenlet.py", line 766, in gevent._greenlet.Greenlet.run
File "./.pyenv/versions/3.5.3/envs/carta-web/lib/python3.5/site-packages/gevent/baseserver.py", line 26, in _handle_and_close_when_done
return handle(*args_tuple)
File "./.pyenv/versions/3.5.3/envs/carta-web/lib/python3.5/site-packages/circus/thrift/servers/gevent.py", line 68, in handle
self.processor.process(iprot, oprot)
File "./.pyenv/versions/3.5.3/envs/carta-web/lib/python3.5/site-packages/circus/thrift/processor.py", line 100, in process
result = tcall_meta.result
AttributeError: 'TApplicationException' object has no attribute 'result'
The issue was because I was using different configurations for the service and for the client.

No "Thread" Module ( python 2.7 )

for some reason I get an error at the line containing this piece of code:
t1 = threading.Thread(target=socket)
this is the error:
Traceback (most recent call last):
File "D:/04 - Media/Python Projects/4 - Networking/Send_Variable_Test/Server.py", line 33, in <module>
t1 = threading.Thread(target=socket)
AttributeError: 'module' object has no attribute 'Thread'
Exception AttributeError: "'module' object has no attribute '_shutdown'" in <module 'threading' from 'D:\04 - Media\Python Projects\4 - Networking\Send_Variable_Test\threading.pyc'> ignored
its obvious from this error that apparently there is no "Thread" module in the threading library, why is this? is the fact that I'm using python 2 the reason?
It looks like you have a file in your path that is called threading.py. Rename that and also delete the .pyc file and it should work.
In particular at this location: D:\04 - Media\Python Projects\4 - Networking\Send_Variable_Test\threading.pyc

Create an executable from Selenium Python for IE with Pyinstaller

I have created a set of python scripts that scrape information out of a website using Internet Explorer. This methodology while not ideal, is the only way I could get it to work as the site does not work well with other browsers and has single-sign on authentication which was difficult to deal with through requests. Anyways, it works. I'd like to be able to share with coworkers without them needing to install python or modify scripts.
I was able to create an executable of the scripts that works on my computer through pyinstaller. When I share with coworkers, though, the get an error "local variable 'browser' referenced before assignment." I tried referencing the IEWebdriverService.exe the binaries field of the pyinstaller .spec file. This caused the size of the .exe to grow so it did something..but it didn't solve the problem.
This is my first time creating an executable and I have really no idea how the IE Driver works so I'm stuck at the moment. Any help would be greatly appreciated. I'm open to using another tool than pyinstaller if that helps, I just found it the easiest to use of the alternatives. I'm using Python 3.5.
thanks.
Edit - Error Log
run # 1
['Part Number = 12649189']
Error
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.ie.se
rvice.Service object at 0x0000000004D00D30>>
Traceback (most recent call last):
File "site-packages\selenium\webdriver\common\service.py", line 173, in __del_
_
File "site-packages\selenium\webdriver\common\service.py", line 145, in stop
AttributeError: 'Service' object has no attribute 'process'
['Part Number = 12649189']
Error
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.ie.se
rvice.Service object at 0x0000000004D00D30>>
Traceback (most recent call last):
File "site-packages\selenium\webdriver\common\service.py", line 173, in __del_
_
File "site-packages\selenium\webdriver\common\service.py", line 145, in stop
AttributeError: 'Service' object has no attribute 'process'
['Part Number = 12649189']
Error
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.ie.se
rvice.Service object at 0x0000000004D00D30>>
Traceback (most recent call last):
File "site-packages\selenium\webdriver\common\service.py", line 173, in __del_
_
File "site-packages\selenium\webdriver\common\service.py", line 145, in stop
AttributeError: 'Service' object has no attribute 'process'
Traceback (most recent call last):
File "Parent_Part_W_UI.py", line 138, in <module>
File "Parent_Part_W_UI.py", line 23, in __init__
File "Parent_Part_W_UI.py", line 40, in init_window
File "Parent_Part_W_UI.py", line 122, in execute_main
UnboundLocalError: local variable 'browser' referenced before assignment

Error pjsua on windows

I want to start programming my SIP client and I started with an example of pjsua to test REGISTRATION CODE
Traceback (most recent call last):
File "D:\work\zscenter\registration.py", line 49, in <module>
lib.create_transport(pj.TransportType.UDP, pj.TransportConfig(5080))
File "C:\Python27\lib\site-packages\pjsua.py", line 2301, in create_transport
err, tp_id = _pjsua.transport_create(type, cfg._cvt_to_pjsua())
File "C:\Python27\lib\site-packages\pjsua.py", line 536, in _cvt_to_pjsua
cfg.qos_type = self.qos_type
AttributeError: '_pjsua.Transport_Config' object has no attribute 'qos_type'
Exception AttributeError: "'NoneType' object has no attribute 'destroy'"
in <bound method Lib.__del__ of <pjsua.Lib instance at 0x0212AE40>> ignored
can someone help me please ?
I installed the latest version and its working fine thanks

AttributeError: 'module' object has no attribute 'TextCalendar'

When I copy the below code in Ideone then it runs fine but it is not running in the text editor and showing the error mentioned in the subject of this post:
import calendar
c = calendar.TextCalendar(calendar.SUNDAY)
c.prmonth(2007, 7)
The complete error is:
Traceback (most recent call last):
File "calendar.py", line 1, in <module>
import calendar
File "/home/shl/Desktop/calendar.py", line 2, in <module>
c = calendar.TextCalendar(calendar.SUNDAY)
AttributeError: 'module' object has no attribute 'TextCalendar'
change the program name from calendar.py to something like calendar_code.py
This wold work properly.
Importing from builtin library when module with same name exists

Categories

Resources