Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

be compatible with pyparsing >= 2.0.1 #81

Closed
GoogleCodeExporter opened this issue Apr 13, 2015 · 19 comments
Closed

be compatible with pyparsing >= 2.0.1 #81

GoogleCodeExporter opened this issue Apr 13, 2015 · 19 comments
Assignees
Labels
Milestone

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Try to install pydot from pip on OS X.

What is the expected output? What do you see instead?

That it installs correctly.

What version of the product are you using? On what operating system?

pydot 1.0.28 on OS X 10.8.2

Please provide any additional information below.

Probably just need an versioned depend on pyparsing, something like:

Index: setup.py
===================================================================
--- setup.py    (revision 29)
+++ setup.py    (working copy)
@@ -31,5 +31,5 @@
         'Topic :: Software Development :: Libraries :: Python Modules'],
     long_description = "\n".join(pydot.__doc__.split('\n')),
     py_modules = ['pydot', 'dot_parser'],
-    install_requires = ['pyparsing', 'setuptools'],
+    install_requires = ['pyparsing<2.0.0', 'setuptools'],
     data_files = [('.', ['LICENSE', 'README'])] )

Original issue reported on code.google.com by WJWwood on 4 Mar 2013 at 1:01

@GoogleCodeExporter
Copy link
Author

Here is the original error output:

https://gist.github.com/wjwwood/5079212

And the related thread I found:

http://sourceforge.net/projects/pyparsing/forums/forum/337293/topic/6481050

Original comment by WJWwood on 4 Mar 2013 at 1:02

@GoogleCodeExporter
Copy link
Author

I came to raise this exact issue.

Original comment by dev.yei...@gmail.com on 26 Mar 2013 at 12:00

@GoogleCodeExporter
Copy link
Author

Obvious to the initiated but not to the newbie: The workaround is to install 
pyparsing < 2.0.0 prior to installing pydot (or a package that depends on 
pydot.)

$ pip install pyparsing==1.5.7

Original comment by inactiv...@gmail.com on 26 Apr 2013 at 1:45

@GoogleCodeExporter
Copy link
Author

Thanks I forgot to post the workaround I used.

Shameless bump, in the mean time I would say that pydot version depending on 
pyparsing would help keep users from hitting this same issue.  I would be in 
favor of dropping the version dependency again after one or more of the major 
operating systems comes with Python3.x as the default version of Python. Until 
then its my opinion that we should flip this around and required the Python3 
users to get the correct version of pyparsing manually.

Original comment by WJWwood on 26 Apr 2013 at 4:46

@GoogleCodeExporter
Copy link
Author

Also came here to report this issue; but also, have a solution -- since the 
setup.py is just a python file, could one do something like this?

if python.version >= 3.0:
    install_requires = ['pyparsing', 'setuptools']
else:
    install_requires = ['pyparsing < 2.0.0', 'setuptools']

Original comment by sh...@shishnet.org on 2 Jul 2013 at 8:41

@GoogleCodeExporter
Copy link
Author

I agree that would be a good solution also, either way I know a tonne of people 
in our community are running into this problem and we have to keep pointing 
them to this issue...

Original comment by WJWwood on 2 Jul 2013 at 5:09

@GoogleCodeExporter
Copy link
Author

Have things improved since the release of pyparsing 2.0.1 is backward 
compatible to Python 2.6 and 2.7?

Original comment by ptmcg...@gmail.com on 3 Aug 2013 at 9:56

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Apr 13, 2015

I can now install pydot against pyparsing 2.0.1, but now I get:

>>> import pydot
Couldn't import dot_parser, loading of dot files will not be possible.

Which is probably worth a new ticket here (if there isn't already one), see:

http://stackoverflow.com/questions/15951748/pydot-and-graphviz-error-couldnt-imp
ort-dot-parser-loading-of-dot-files-will

Original comment by WJWwood on 3 Aug 2013 at 6:24

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Apr 13, 2015

in dot_patser.py:

  • remove _noncomma from the 28
  • add the below at line 30 of: _noncomma = "".join( [ c for c in printables if c != "," ] )

_-prefixed variables should be considered private to the module!

Original comment by grizzly.nyo on 31 Aug 2013 at 11:37

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Apr 13, 2015

See http://stackoverflow.com/a/21462609/722624

Original comment by david.vi...@gmail.com on 30 Jan 2014 at 4:54

@GoogleCodeExporter
Copy link
Author

This is the patch i'm about to apply to the Debian package

Original comment by sandro.tosi on 11 Mar 2014 at 7:16

Attachments:

@GoogleCodeExporter
Copy link
Author

Sandro, thanks for the patch.

Original comment by mar...@martindengler.com on 12 Mar 2014 at 2:03

@GoogleCodeExporter
Copy link
Author

Is there any possibility of getting a pydot release with sandro.tosi's patch?

Original comment by mar...@martindengler.com on 11 Apr 2014 at 2:52

@GoogleCodeExporter
Copy link
Author

To clarify, if you look at the last stackoverflow link, there's a fork with the 
patch applied. But yeah - this is a major issue. Bump?

Original comment by davcl...@gmail.com on 8 Aug 2014 at 6:30

@GoogleCodeExporter
Copy link
Author

bump

Original comment by asilen...@mirantis.com on 24 Feb 2015 at 4:38

@eraoul
Copy link

eraoul commented Jun 20, 2015

Any progress here?

This fixes it for me:
pip install pydot2

import dot_parser

Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/2.7/site-packages/dot_parser.py", line 23, in
from pyparsing import ( nestedExpr, Literal, CaselessLiteral, Word, Upcase, OneOrMore, ZeroOrMore,
ImportError: cannot import name _noncomma

@vdboor
Copy link

vdboor commented Aug 18, 2015

It seems pip install pydot2 is a nice workaround.

@sandrotosi
Copy link

FTR: I updated the patch (and so even the package) we use in Debian to https://anonscm.debian.org/cgit/python-modules/packages/pydot.git/tree/debian/patches/0002-support-python3.patch (which is basically https://github.com/nlhepler/pydot/ as of today)

@johnyf johnyf self-assigned this May 10, 2016
@johnyf johnyf changed the title pydot depends on pyparsing, the newest version of which is Py3 only update to pyparsing >= 2.0.1 May 11, 2016
@johnyf johnyf added this to the 1.1.0 milestone May 11, 2016
@johnyf
Copy link
Contributor

johnyf commented May 23, 2016

6dff94b fixes this issue, by applying the changes suggested above, and present in nlhelper/pydot and other forks, (to not from pyparsing import _noncomma), and also the unused pyparsing.Upcase, which has been removed too from pyparsing >= 2.0.1.

Note that these changes make pydot >= 1.1.0 compatible with pyparsing >= 1.5.7.

@johnyf johnyf closed this as completed May 23, 2016
@johnyf johnyf changed the title update to pyparsing >= 2.0.1 be compatible with pyparsing >= 2.0.1 May 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants