donnemartin / saws

A supercharged AWS command line interface (CLI).
Other
5.25k stars 282 forks source link

Pygments unresolved import. Cannot import name words #63

Closed OAuthBringer closed 9 years ago

OAuthBringer commented 9 years ago

Seems the v2.0.2 of Pygments does not support pygments.lexer.words

CentOS Linux release 7.1.1503 (Core) Python 2.7.6

sudo pip install saws
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting saws
/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Using cached saws-0.3.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): awscli>=1.7.46 in /usr/lib/python2.7/site-packages (from saws)
Requirement already satisfied (use --upgrade to upgrade): click>=4.0 in /usr/lib/python2.7/site-packages (from saws)
Requirement already satisfied (use --upgrade to upgrade): configobj>=5.0.6 in /usr/lib/python2.7/site-packages (from saws)
Requirement already satisfied (use --upgrade to upgrade): prompt-toolkit==0.52 in /usr/lib/python2.7/site-packages (from saws)
Requirement already satisfied (use --upgrade to upgrade): six>=1.9.0 in /usr/lib/python2.7/site-packages (from saws)
Requirement already satisfied (use --upgrade to upgrade): pygments>=2.0.2 in /usr/lib/python2.7/site-packages (from saws)
Requirement already satisfied (use --upgrade to upgrade): enum34>=1.0.4 in /usr/lib/python2.7/site-packages (from saws)
Requirement already satisfied (use --upgrade to upgrade): botocore==1.2.11 in /usr/lib/python2.7/site-packages (from awscli>=1.7.46->saws)
Requirement already satisfied (use --upgrade to upgrade): rsa<=3.3.0,>=3.1.2 in /usr/lib/python2.7/site-packages (from awscli>=1.7.46->saws)
Requirement already satisfied (use --upgrade to upgrade): colorama<=0.3.3,>=0.2.5 in /usr/lib/python2.7/site-packages (from awscli>=1.7.46->saws)
Requirement already satisfied (use --upgrade to upgrade): docutils>=0.10 in /usr/lib/python2.7/site-packages (from awscli>=1.7.46->saws)
Requirement already satisfied (use --upgrade to upgrade): wcwidth in /usr/lib/python2.7/site-packages (from prompt-toolkit==0.52->saws)
Requirement already satisfied (use --upgrade to upgrade): jmespath<1.0.0,>=0.7.1 in /usr/lib/python2.7/site-packages (from botocore==1.2.11->awscli>=1.7.46->saws)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil<3.0.0,>=2.1 in /usr/lib/python2.7/site-packages (from botocore==1.2.11->awscli>=1.7.46->saws)
Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.3 in /usr/lib/python2.7/site-packages (from rsa<=3.3.0,>=3.1.2->awscli>=1.7.46->saws)
Installing collected packages: saws
  Running setup.py install for saws
Successfully installed saws-0.3.2
saws
Traceback (most recent call last):
  File "/bin/saws", line 9, in <module>
    load_entry_point('saws==0.3.2', 'console_scripts', 'saws')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/saws/main.py", line 20, in <module>
    from .saws import Saws
  File "/usr/lib/python2.7/site-packages/saws/saws.py", line 37, in <module>
    from .lexer import CommandLexer
  File "/usr/lib/python2.7/site-packages/saws/lexer.py", line 17, in <module>
    from pygments.lexer import words
ImportError: cannot import name words

pip freeze:

jmespath==0.9.0
jsonschema==2.5.1
kitchen==1.1.1
lxml==3.2.1
MarkupSafe==0.23
matplotlib==1.2.0
mistune==0.7
nose==1.3.7
numexpr==2.4.3
numpy==1.7.1
numpydoc==0.5
pandas==0.16.2
paramiko==1.15.1
Paste==2.0.2
Pillow==2.0.0
plotly==1.8.6
policycoreutils-default-encoding==0.1
prompt-toolkit==0.52
ptyprocess==0.5
pyasn1==0.1.6
pycrypto==2.6.1
pycurl==7.19.0

*Pygments==2.0.2*

pygobject==3.8.2
pygpgme==0.3
pyliblzma==0.5.3
pyparsing==1.5.6
python-dateutil==2.4.2
python-keyczar==0.71rc0
pytz==2015.4
pyudev==0.15
pyxattr==0.5.1
PyYAML==3.10
pyzmq==14.7.0
requests==2.7.0
rethinkdb==2.0.0.post1
rsa==3.2
saws==0.3.2
scikit-learn==0.16.1
scipy==0.12.1
seaborn==0.6.0
seobject==0.1
sepolicy==1.1
setroubleshoot==1.1
six==1.9.0
slacker==0.7.3
slip==0.4.0
slip.dbus==0.4.0
snowballstemmer==1.2.0
Sphinx==1.3.1
sphinx-rtd-theme==0.1.8
sympy==0.7.6
terminado==0.5
toolz==0.7.4
tornado==4.2.1
urlgrabber==3.10
urllib3==1.11
wcwidth==0.1.5
Werkzeug==0.10.4
xlrd==0.9.4
xlwt==1.0.0
OAuthBringer commented 9 years ago

Hrm... not sure what's going on here. Found the source

http://bitbucket.org/birkenfeld/pygments-main and there is certainly a words class there... but there isn't any in my current distribution... Probably not on ya'lls end, but reporting anyway.

donnemartin commented 9 years ago

@neolytics it seems like you might have a dependency issue because you are installing via sudo pip and you have a number of python packages installed already. Does it help if you reinstall pygments? If the reinstall doesn't work, can you try installing in a virtualenv?

Virtualenv installation instructions

donnemartin commented 9 years ago

@neolytics are you still seeing the issues?

OAuthBringer commented 9 years ago

@donnemartin Looks like it's been resolved. Despite the output of pip freeze above the version of pygments that was already installed was actually pygments-1-4. uninstall + reinstall resolved. Thanks!

donnemartin commented 9 years ago

@neolytics great! Glad everything's working, thanks for the follow up.

mxi1 commented 8 years ago

it works for me, thanks.