awslabs / aws-shell

An integrated shell for working with the AWS CLI.
Apache License 2.0
7.15k stars 770 forks source link

pkg_resources.DistributionNotFound: Pygments>=2.1.3,<3.0.0 on Ubuntu 12 #149

Closed joelhandwell closed 7 years ago

joelhandwell commented 7 years ago

Getting following error to run command aws-shell in Ubuntu 12. Installation seems problem.

root@ubuntu12:/var/lib/jenkins# aws-shell
Traceback (most recent call last):
  File "/usr/local/bin/aws-shell", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2707, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 686, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: Pygments>=2.1.3,<3.0.0

System info (before install):

root@ubuntu12:/var/lib/jenkins# cat /etc/apt/sources.list.d/fkrull-deadsnakes-python2_7-precise.list
deb http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu precise main
deb-src http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu precise main

root@ubuntu12:/var/lib/jenkins# python -V
Python 2.7.12

root@ubuntu12:/var/lib/jenkins# pip list
distribute (0.6.24dev-r0)
pip (8.1.2)
setuptools (0.6rc11)

Install method:

root@ubuntu12:/var/lib/jenkins# pip install aws-shell
Collecting aws-shell
  Using cached aws-shell-0.1.1.tar.gz
Collecting awscli<2.0.0,>=1.10.30 (from aws-shell)
  Using cached awscli-1.10.59-py2.py3-none-any.whl
Collecting prompt-toolkit<1.1.0,>=1.0.0 (from aws-shell)
  Downloading prompt_toolkit-1.0.7-py2-none-any.whl (237kB)
    100% |████████████████████████████████| 245kB 3.0MB/s
Collecting boto3<2.0.0,>=1.2.1 (from aws-shell)
  Downloading boto3-1.4.0-py2.py3-none-any.whl (117kB)
    100% |████████████████████████████████| 122kB 5.8MB/s
Collecting configobj<6.0.0,>=5.0.6 (from aws-shell)
  Downloading configobj-5.0.6.tar.gz
Collecting Pygments<3.0.0,>=2.1.3 (from aws-shell)
  Downloading Pygments-2.1.3-py2.py3-none-any.whl (755kB)
    100% |████████████████████████████████| 757kB 874kB/s
Collecting docutils>=0.10 (from awscli<2.0.0,>=1.10.30->aws-shell)
  Using cached docutils-0.12.tar.gz
Collecting colorama<=0.3.7,>=0.2.5 (from awscli<2.0.0,>=1.10.30->aws-shell)
  Using cached colorama-0.3.7-py2.py3-none-any.whl
Collecting s3transfer<0.2.0,>=0.1.0 (from awscli<2.0.0,>=1.10.30->aws-shell)
  Using cached s3transfer-0.1.2-py2.py3-none-any.whl
Collecting botocore==1.4.49 (from awscli<2.0.0,>=1.10.30->aws-shell)
  Using cached botocore-1.4.49-py2.py3-none-any.whl
Collecting rsa<=3.5.0,>=3.1.2 (from awscli<2.0.0,>=1.10.30->aws-shell)
  Using cached rsa-3.4.2-py2.py3-none-any.whl
Collecting six>=1.9.0 (from prompt-toolkit<1.1.0,>=1.0.0->aws-shell)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting wcwidth (from prompt-toolkit<1.1.0,>=1.0.0->aws-shell)
  Downloading wcwidth-0.1.7-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from boto3<2.0.0,>=1.2.1->aws-shell)
  Using cached jmespath-0.9.0-py2.py3-none-any.whl
Collecting futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" (from s3transfer<0.2.0,>=0.1.0->awscli<2.0.0,>=1.10.30->aws-shell)
  Using cached futures-3.0.5-py2-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.4.49->awscli<2.0.0,>=1.10.30->aws-shell)
  Using cached python_dateutil-2.5.3-py2.py3-none-any.whl
Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli<2.0.0,>=1.10.30->aws-shell)
  Using cached pyasn1-0.1.9-py2.py3-none-any.whl
Installing collected packages: docutils, colorama, futures, jmespath, six, python-dateutil, botocore, s3transfer, pyasn1, rsa, awscli, wcwidth, prompt-toolkit, boto3, configobj, Pygments, aws-shell
  Running setup.py install for docutils ... done
  Running setup.py install for configobj ... done
  Running setup.py install for aws-shell ... done
Successfully installed Pygments-2.1.3 aws-shell-0.1.1 awscli-1.10.59 boto3-1.4.0 botocore-1.4.49 colorama-0.3.7 configobj-5.0.6 docutils-0.12 futures-3.0.5 jmespath-0.9.0 prompt-toolkit-1.0.7 pyasn1-0.1.9 python-dateutil-2.5.3 rsa-3.4.2 s3transfer-0.1.2 six-1.10.0 wcwidth-0.1.7

pip packages after aws-shell installation includes Pygments (2.1.3) although aws-shell claims not found:

root@ubuntu12:/var/lib/jenkins# pip list
aws-shell (0.1.1)
awscli (1.10.59)
boto3 (1.4.0)
botocore (1.4.49)
colorama (0.3.7)
configobj (5.0.6)
distribute (0.6.24dev-r0)
docutils (0.12)
futures (3.0.5)
jmespath (0.9.0)
pip (8.1.2)
prompt-toolkit (1.0.7)
pyasn1 (0.1.9)
Pygments (2.1.3)
python-dateutil (2.5.3)
rsa (3.4.2)
s3transfer (0.1.2)
setuptools (0.6rc11)
six (1.10.0)
wcwidth (0.1.7)

Anyone had similar issue?

donnemartin commented 7 years ago

Hi @joelhandwell,

Getting following error to run command aws-shell in Ubuntu 12

I just tried this on a fresh 2.7 virtualenv on Ubuntu 14.04 LTS without any issues. Might have something to do with Ubuntu 12?

joelhandwell commented 7 years ago

@donnemartin It can be Ubuntu 12. But also it can be my python installation is of ppa:fkrull/deadsnakes-python2.7 without using virtualenv.

donnemartin commented 7 years ago

Good point, could you try to install in a virtualenv to see if that fixes it?

In case you're not sure how to, here are some instructions on how to install in a virtualenv (using virtualenvwrapper).

Install virtualenv and virtualenvwrapper:

pip install virtualenv
pip install virtualenvwrapper
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

Create an aws-shell virtualenv and install aws-shell:

mkvirtualenv aws-shell
pip install aws-shell

If you want to activate the aws-shell virtualenv again later, run:

workon aws-shell
joelhandwell commented 7 years ago

Ubuntu 12 is reaching its end of life so closing this issue. If there is need, please comment or reopen.