0
I’m wondering if there is a possibility to add a non-native library from python
.
Example, I’m using the NetworkX
to create graph, I need to install the library and everything else.
I am wanting to add this library directly to the program, in case I use it on another pc so I no longer need to install it, kind of already encapsulate this library to the code.
Is there any way to do that?
Thank you.
thanks for the answer. But how would this first way Voce answered? Thanks
– Hugo Kenji Okada
You can let me know if it is in the same folder as your code, which folder name and code?
– Vinicius Mesel
I have the downloaded framework which is Networkx, I can put it in the same folder where my code is, the folder name is paa, the folder name of the framework is networkx and the code is redestream.py.
– Hugo Kenji Okada
you probably have to run: from networkx import * or from networkx import networkx
– Vinicius Mesel
There were some errors, according to your recommendation, I will put the error:
'Traceback (most recent call last):
 File "rede_fluxo_max.py", line 2, in <module>
 from networkx import *
 File "/home/ubuntu/Documentos/paa/networkx/__init__.py", line 56, in <module>
 import networkx.utils
 File "/home/ubuntu/Documentos/paa/networkx/utils/__init__.py", line 2, in <module>
 from networkx.utils.decorators import *
 File "/home/ubuntu/Documentos/paa/networkx/utils/decorators.py", line 7, in <module>
 from decorator import decorator
ImportError: No module named 'decorator'
– Hugo Kenji Okada
tries to put:
from networkx import *
– Vinicius Mesel
Or check out this link: [http://stackoverflow.com/questions/4383571/importing-files-from-different-folder-in-python]
– Vinicius Mesel