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

pygments dependency not respected in virtualenv #25

Closed
a6 opened this issue Apr 8, 2017 · 4 comments
Closed

pygments dependency not respected in virtualenv #25

a6 opened this issue Apr 8, 2017 · 4 comments

Comments

@a6
Copy link

a6 commented Apr 8, 2017

I don't understand the problem here, but saspy won't install in a fresh virtualenv because the pygments package is missing. Despite it being listed in the install_requirements in the setup.py, it does not trigger a dependency installation. In python 3.5 on ubuntu 14.04, pip install saspy fails with:

Collecting saspy
  Using cached saspy-2.1.4.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-k1_nkvcf/saspy/setup.py", line 24, in <module>
        from saspy import __version__
      File "/tmp/pip-build-k1_nkvcf/saspy/saspy/__init__.py", line 16, in <module>
        from saspy.sasbase     import *
      File "/tmp/pip-build-k1_nkvcf/saspy/saspy/sasbase.py", line 61, in <module>
        from saspy.sasstat import *
      File "/tmp/pip-build-k1_nkvcf/saspy/saspy/sasstat.py", line 17, in <module>
        from saspy.sasproccommons import SASProcCommons
      File "/tmp/pip-build-k1_nkvcf/saspy/saspy/sasproccommons.py", line 18, in <module>
        from saspy.sasresults import SASresults
      File "/tmp/pip-build-k1_nkvcf/saspy/saspy/sasresults.py", line 17, in <module>
        from saspy.SASLogLexer import SASLogStyle, SASLogLexer
      File "/tmp/pip-build-k1_nkvcf/saspy/saspy/SASLogLexer.py", line 16, in <module>
        from pygments.lexer import RegexLexer
    ImportError: No module named 'pygments'

The problem is fully resolved by installing pygments first via pip and then installing saspy.

@jld23
Copy link
Contributor

jld23 commented Apr 11, 2017

I think the issue is with pip and that pygments is expected to be built before saspy. Here is an issue that seems to have the same behavior: pypa/pip#25

@jwodder
Copy link

jwodder commented Jun 8, 2017

No, this is a bug in saspy's setup.py, which tries to import saspy when run, which ultimately causes Python to try to import pygments even though pip can't tell that pygments needs to be installed until after it's run setup.py. See https://packaging.python.org/single_source_version/ for various ways to get the version number correctly.

@jld23
Copy link
Contributor

jld23 commented Jun 9, 2017

@jwodder If I understand your comment correctly, I'm using an import of the version in line 24 of setup.py that is ultimately calling pygments even thought is necessarily installed yet. This corresponds to Item 6 in the link you included in your comment.

If I've understood correctly, do you have a recommendation for which pattern I should adopt?
Thank you for helping resolve this issue!

FriedEgg added a commit to FriedEgg/saspy that referenced this issue Jun 9, 2017
Signed-off-by: Matthew Kastin <fried.egg@verizon.net>
@FriedEgg FriedEgg mentioned this issue Jun 9, 2017
@jld23 jld23 closed this as completed in #41 Jun 9, 2017
jld23 pushed a commit that referenced this issue Jun 9, 2017
* Fixes #25

Signed-off-by: Matthew Kastin <fried.egg@verizon.net>

* Update __init__.py

Add newline at end
@a6
Copy link
Author

a6 commented Jun 20, 2017

Much appreciated, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants