MJL85 / natlas

natlas - Network Discovery and Auto-Diagramming
GNU General Public License v2.0
526 stars 114 forks source link

Dosn´t run on Linux and Mac #46

Open Phill93 opened 5 years ago

Phill93 commented 5 years ago

Hi,

i have tried to run natlas on Mac and on Linux, in both cases natlas-cli.py chrashes with this error:

Traceback (most recent call last):
  File "./natlas-cli.py", line 35, in <module>
    import natlas
  File "/vagrant/natlas/__init__.py", line 2, in <module>
    from .natlas import natlas
  File "/vagrant/natlas/natlas.py", line 35, in <module>
    from .network import natlas_network
  File "/vagrant/natlas/network.py", line 29, in <module>
    from .util import *
  File "/vagrant/natlas/util.py", line 34, in <module>
    from .snmp import *
  File "/vagrant/natlas/snmp.py", line 27, in <module>
    from pysnmp.entity.rfc3413.oneliner.cmdgen import cmdgen
ImportError: No module named pysnmp.entity.rfc3413.oneliner.cmdgen
spazman998 commented 5 years ago

looks like you don't have pysnmp installed? on windows pip install mnet gave me all those. I can browse to that python file. C:\Program Files\Python37\Lib\site-packages\pysnmp\entity\rfc3413\oneliner\cmdgen.py

Phill93 commented 5 years ago

Here is a asciinema that shows what I have installed and how i get the error message.

asciicast

spazman998 commented 5 years ago

I see you have natlas installed... however i have installed this via mnet... which is the main collection. pip install mnet https://pypi.org/project/mnet/

Phill93 commented 5 years ago

mnet dosn´t run under linux because its using dos line endings. If i have time i try to convert these to unix line endings

bbrendon commented 5 years ago

Regarding the error : ImportError: No module named pysnmp.entity.rfc3413.oneliner

If your "python" is python 2.7 you will get this error. If you prefix natlas-cli.py with python3 the problem will be resolved.

# head -1 natlas-cli.py
#!/usr/bin/python

# /usr/bin/python -V
Python 2.7.13

It seems the real issue is that it only supports checking which version of python 3 is running because it breaks before it can check if you're on python 2.7.

# python3 natlas-cli.py
Requires Python 3.6

# python2.7 natlas-cli.py
Traceback (most recent call last):
  File "natlas-cli.py", line 35, in <module>
    import natlas
  File "/root/natlas/natlas/__init__.py", line 2, in <module>
    from .natlas import natlas
  File "/root/natlas/natlas/natlas.py", line 35, in <module>
    from .network import natlas_network
  File "/root/natlas/natlas/network.py", line 29, in <module>
    from .util import *
  File "/root/natlas/natlas/util.py", line 34, in <module>
    from .snmp import *
  File "/root/natlas/natlas/snmp.py", line 27, in <module>
    from pysnmp.entity.rfc3413.oneliner import cmdgen
ImportError: No module named pysnmp.entity.rfc3413.oneliner
Pintstr commented 4 years ago

git clone https://github.com/MJL85/natlas.git; cd natlas; sudo python setup.py install; sudo python3 pip install -m pysnmp>=4.2.5 graphviz pydot; python3 natlas-cli.py --help