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

Error after installing on Mac #15

Closed
TravelingTechGuy opened this issue Sep 21, 2015 · 12 comments
Closed

Error after installing on Mac #15

TravelingTechGuy opened this issue Sep 21, 2015 · 12 comments
Labels

Comments

@TravelingTechGuy
Copy link

Installed using sudo -H pip install saws, after seeing this comment:

The directory '/Users/user/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Running saws now yields this error:

$ saws
Traceback (most recent call last):
  File "/usr/local/bin/saws", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: pygments>=2.0.2

Mac OS 10.9.5, Python 2.7.5

@donnemartin
Copy link
Owner

Guy,

It sounds like a permissions issue and you've already tried the sudo -H approach. Have you tried this as well?

http://stackoverflow.com/a/27871374

It seems like it's not able to download pygments 2.0.2. Curious what happens if you try:

pip install pygments

In any case, I highly recommend using virtualenv or virtualenvwrapper. Here's a handy guide:

http://docs.python-guide.org/en/latest/dev/virtualenvs/

-Donne

@TravelingTechGuy
Copy link
Author

Actually, pygments is installed:

$ pip install pygments
Requirement already satisfied (use --upgrade to upgrade): pygments in /Library/Python/2.7/site-packages

if I try --upgrade I get:

$ pip install pygments --upgrade
/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/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
Requirement already up-to-date: pygments in /Library/Python/2.7/site-packages

Could that be the root cause?

Also, my user was already the owner of /Users/user/Library/Caches/pip, as suggested in the SO answer - but I ran the chown command anyway - still no joy.

@donnemartin
Copy link
Owner

Curious what version of Pygments is installed, if it's less than 2.0.2. Could you try the following?

python -c "import pygments; print(pygments.__version__)"

@TravelingTechGuy
Copy link
Author

2.0.2

@donnemartin
Copy link
Owner

Hmm odd. You traceback says:

pkg_resources.DistributionNotFound: pygments>=2.0.2

yet it seems like pygments can't be found, but it's returning 2.0.2 when you run:

python -c "import pygments; print(pygments.__version__)"

Unfortunately I'm not a packaging expert :)

Could you try installing in a virtualenv to get a 'clean' install and ensure there aren't any odd dependencies/permissions preventing you from installing/running?

@TravelingTechGuy
Copy link
Author

Ok, I may try that. Just wanted to leave you with the results of what I just tried.

  1. I uninstalled pygments
  2. I installed pyopenssl ndg-httpsclient pyasn1 - to get rid of that SSL comment
  3. Re installed pygments - it's at version 2.0.2
  4. Re-ran sudo -H pip install saws --upgrade and got:
$ sudo -H pip install saws --upgrade
Requirement already up-to-date: saws in /Library/Python/2.7/site-packages
Requirement already up-to-date: awscli>=1.7.46 in /Library/Python/2.7/site-packages (from saws)
Requirement already up-to-date: click>=4.0 in /Library/Python/2.7/site-packages (from saws)
Requirement already up-to-date: configobj>=5.0.6 in /Library/Python/2.7/site-packages (from saws)
Requirement already up-to-date: enum34>=1.0.4 in /Library/Python/2.7/site-packages (from saws)
Requirement already up-to-date: fuzzyfinder>=1.0.0 in /Library/Python/2.7/site-packages (from saws)
Requirement already up-to-date: ordereddict>=1.1 in /Library/Python/2.7/site-packages (from saws)
Requirement already up-to-date: prompt-toolkit>=0.46 in /Library/Python/2.7/site-packages (from saws)
Requirement already up-to-date: six>=1.9.0 in /Library/Python/2.7/site-packages (from saws)
Requirement already up-to-date: pygments>=2.0.2 in /Library/Python/2.7/site-packages (from saws)
Requirement already up-to-date: colorama<=0.3.3,>=0.2.5 in /Library/Python/2.7/site-packages (from awscli>=1.7.46->saws)
Requirement already up-to-date: botocore==1.2.4 in /Library/Python/2.7/site-packages (from awscli>=1.7.46->saws)
Requirement already up-to-date: rsa<=3.1.4,>=3.1.2 in /Library/Python/2.7/site-packages (from awscli>=1.7.46->saws)
Requirement already up-to-date: docutils>=0.10 in /Library/Python/2.7/site-packages (from awscli>=1.7.46->saws)
Requirement already up-to-date: wcwidth in /Library/Python/2.7/site-packages (from prompt-toolkit>=0.46->saws)
Requirement already up-to-date: jmespath==0.7.1 in /Library/Python/2.7/site-packages (from botocore==1.2.4->awscli>=1.7.46->saws)
Requirement already up-to-date: python-dateutil<3.0.0,>=2.1 in /Library/Python/2.7/site-packages (from botocore==1.2.4->awscli>=1.7.46->saws)
Requirement already up-to-date: pyasn1>=0.1.3 in /Library/Python/2.7/site-packages (from rsa<=3.1.4,>=3.1.2->awscli>=1.7.46->saws)

(See pygments line confirming version)

  1. Ran saws, got the same error:
Traceback (most recent call last):
  File "/usr/local/bin/saws", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: pygments>=2.0.2

I'm not a python guy, so I have no idea where your package is looking for other packages. But I do appreciate your time and effort in putting this together and trying to help me. At this point, it looks more like a PIP issue than anything else.

@donnemartin
Copy link
Owner

Thanks Guy, sorry you weren't able to get it working on your setup.

If you do try it with a virtualenv please let me know.

I'll keep this open in case anyone else has a similar issue, I can try to diagnose further if it is more widespread.

@polds
Copy link

polds commented Sep 22, 2015

@donnemartin Also have this issue too:

Traceback (most recent call last):
  File "/usr/local/bin/saws", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2797, in <module>
    parse_requirements(__requires__), Environment()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 576, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: six>=1.9.0

Also running pygments version 2.0.2

EDIT: I see this when running a sudo pip install saws:

removing '/Library/Python/2.7/site-packages/awscli-1.8.6-py2.7.egg-info' (and everything under it)

Copying awscli.egg-info to /Library/Python/2.7/site-packages/awscli-1.8.6-py2.7.egg-info

running install_scripts

copying build/scripts-2.7/aws -> /usr/local/bin

error: [Errno 2] No such file or directory: '/usr/local/bin/aws'

----------------------------------------
  Rolling back uninstall of awscli
Cleaning up...
Command /usr/bin/python -c "import setuptools;__file__='/private/tmp/pip_build_root/awscli/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-4egtUg-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/tmp/pip_build_root/awscli
Storing complete log in /var/root/Library/Logs/pip.log

@donnemartin
Copy link
Owner

Hi Peter, Guy,

Could you try installing in a virtualenv and see if you are having the same problem? Here are the command lines to run.

Install virtualenv and virtualenvwrapper:

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

Create a SAWS virtualenv and install SAWS:

mkvirtualenv saws
pip install saws

For more details (and for instructions on how to install on Windows using virtualenvwrapper-win), check out this link.

-Donne

@polds
Copy link

polds commented Sep 22, 2015

Using a virtual env worked.

@donnemartin
Copy link
Owner

Great! Package dependencies/permissions can get tricky, virtualenv is a great too to manage them.

Repository owner locked and limited conversation to collaborators Sep 23, 2015
@donnemartin
Copy link
Owner

Using a virtual env worked. -polds

I updated the README with the following a note about virtualenv:

Pip Installation

...snip...

SAWS is hosted on PyPi. The following command will install SAWS along with dependencies such as the AWS CLI:

$ pip install saws

I highly recommend installing Python packages in a virtualenv to avoid any issues with dependencies or permissions.

Once installed, run the following command to start SAWS:

$ saws

...snip...

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

No branches or pull requests

3 participants