mpenning / ciscoconfparse

Parse, Audit, Query, Build, and Modify Arista / Cisco / Juniper / Palo Alto / F5 configurations.
http://www.pennington.net/py/ciscoconfparse/
GNU General Public License v3.0
793 stars 220 forks source link

does not install properly for version 1.1.1 with python 3.4 #7

Closed jacobcase closed 10 years ago

jacobcase commented 10 years ago

Using Linux Mint 17, the command sudo python3 setup.py install initially gives an error with print diff in excldiff_test.py. This was fixed by wrapping diff in parenthesis.

After that, it installed the package in /usr/local/lib/python3.4/dist-packages/ciscoconfparse-1.1.1-py3.4.egg/ciscoconfparse rather than /usr/local/lib/python3.4/dist-packages/ciscoconfparse. This made the need for from ciscoconfparse import CiscoConfParse as show in tutorials to become from ciscoconfparse.ciscoconfparse import CiscoConfParse. I don't know if this is a bug or intended behavior and the documentation hasn't been updated. I temprarily fixed this by moving the ciscoconfparse directory up a level, and making a change to easy-install.pth. I'm pretty new to python, but I installed the way that is shown in the tutorial. I also get the same results using pip3.

mpenning commented 10 years ago

I can confirm that you're indeed hitting a bug. Python3 is doing something which breaks my existing setup.py; this is probably my fault, but it's taking longer than I would like to fix it.

In the mean time... some possible workarounds...

(py34_test)[mpenning@tsunami ~]$ python
Python 3.4.1 (default, Jul 25 2014, 03:44:51)
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append('/opt/ciscoconfparse-1.1.1/ciscoconfparse')
>>> from ciscoconfparse import CiscoConfParse
>>> quit()
(py34_test)[mpenning@tsunami ~]$

I'm trying to find a better solution; however, I seem to discover new things I don't understand about python packaging every time I've tried working on it.