Closed jacobcase closed 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...
pip
or easy_install
easy_install
/ pip
in python3, manually untar ciscoconfparse into a directory (use /opt/ciscoconfparse
for example), add sys.path.append('/opt/ciscoconfparse-1.1.1/ciscoconfparse')
at the top of your script, then from ciscoconfparse import CiscoConfParse
as normal with python3. .(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.
Using Linux Mint 17, the command
sudo python3 setup.py install
initially gives an error withprint diff
in excldiff_test.py. This was fixed by wrappingdiff
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 forfrom ciscoconfparse import CiscoConfParse
as show in tutorials to becomefrom 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.