Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws (pip) returns invalid syntax

I am trying to install Amazon Web Services in pip, with

pip3 install awscli

but I am getting an error when I try to run aws or aws configure in that case:

Traceback (most recent call last):
  File "/usr/local/bin/aws", line 7, in <module>
    from aws.main import main
  File "/usr/local/lib/python3.6/site-packages/aws/main.py", line 23
    print '%(name)s: %(endpoint)s' % {

any clues?

like image 796
wizofe Avatar asked Sep 16 '17 16:09

wizofe


People also ask

How do I fix PIP invalid syntax?

If you get a "SyntaxError: invalid syntax" when trying to install a module using pip , make sure to run the command from your shell, e.g. bash or PowerShell, and not by running a Python file that contains the pip install your_module command.

Why is pip install invalid syntax?

The python pip invalid syntax error is occurring because pip is run from the command line, not the Python interpreter. It is a program that installs modules, so you can use them from Python. Once you have installed the module, then you can open the Python shell and do import selenium.


1 Answers

I had the same issue with python 3.6.

This is actually a different package, confusingly named "aws" which is throwing the error: https://github.com/eofs/aws

Make sure you run

pip install awscli

NOT pip install aws

To find out which "aws" package you are calling run:

 which aws
like image 113
Stryker Avatar answered Sep 20 '22 01:09

Stryker