#๐ Discord bot help
38 messages ยท Page 1 of 1 (latest)
@proud holly
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.
A full traceback could look like:
Traceback (most recent call last):
File "my_file.py", line 5, in <module>
add_three("6")
File "my_file.py", line 2, in add_three
a = num + 3
~~~~^~~
TypeError: can only concatenate str (not "int") to str
If the traceback is long, use our pastebin.
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
Error:
from network import authority_matrix
ImportError: cannot import name 'authority_matrix' from 'network' (C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\network.py)
How do I upload authority_matrix to the nerworkX library? I searched the internet, no solution helped.
I accidentally made a mistake.
but I don't know which is actually correct lmao
just copy the one that is correct
and paste it
!pypi networkX
I wrote pip install networkx, says it's already downloaded. The error is that I don't have authority_matrix in the networkx library, so I'm asking how to add it to the library.
The code that imports the file? Could you explain a little more clearly?)
I need some confirmation of stuff, since I identified 2 issue:
- Module: networkx should be import using name
networkxas stated in the example in README:
>>> import networkx as nx
>>> G = nx.Graph()
>>> G.add_edge("A", "B", weight=4)
>>> G.add_edge("B", "D", weight=2)
>>> G.add_edge("A", "C", weight=3)
>>> G.add_edge("C", "D", weight=4)
>>> nx.shortest_path(G, "A", "D", weight="weight")
['A', 'B', 'D']
authority_matrixfromnetworkxhave been deperceded at version 2.6
[#4617] Deprecate hub_matrix and authority_matrix
and removed in version 3.0
Remove deprecated functions hub_matrix and authority_matrix (#5767)
the code that you wrote
lmao
My error is not given by networkx, but by authority_matrix, because it is not in the network library. And the error appears when I want to launch the bot.
yeah, because it no longer exist now + you import the wrong thing either way
If sometimes it's not clear what I'm writing, then I'm sorry, the translator translates that way)
What can be replaced?
Downgrading networkx
And how do I fix this error?
pip unistall networkx
pip install networkx~=2.5.0
and also fix your code
you are importing network, not networkx
I did everything, but the result is still the same.
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.