akamai / httpie-edgegrid

Plugin for httpie to allow edge grid authentication for Akamai
Apache License 2.0
67 stars 22 forks source link

"SyntaxError: invalid syntax" when running `python setup.py install` #22

Closed aldrichdev closed 2 years ago

aldrichdev commented 3 years ago

I am encountering an error when trying to install this. Tried this on both a Windows and a Mac - same error. Below output is from Windows.

PS C:\dev\diamond\httpie-edgegrid> python setup.py install
running install
running bdist_egg
running egg_info
creating httpie_edgegrid.egg-info
writing requirements to httpie_edgegrid.egg-info\requires.txt
writing httpie_edgegrid.egg-info\PKG-INFO
writing top-level names to httpie_edgegrid.egg-info\top_level.txt
writing dependency_links to httpie_edgegrid.egg-info\dependency_links.txt
writing entry points to httpie_edgegrid.egg-info\entry_points.txt
writing manifest file 'httpie_edgegrid.egg-info\SOURCES.txt'
reading manifest file 'httpie_edgegrid.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'httpie_edgegrid.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib
copying httpie_edgegrid.py -> build\lib
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
copying build\lib\httpie_edgegrid.py -> build\bdist.win-amd64\egg
byte-compiling build\bdist.win-amd64\egg\httpie_edgegrid.py to httpie_edgegrid.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying httpie_edgegrid.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying httpie_edgegrid.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying httpie_edgegrid.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying httpie_edgegrid.egg-info\entry_points.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying httpie_edgegrid.egg-info\not-zip-safe -> build\bdist.win-amd64\egg\EGG-INFO
copying httpie_edgegrid.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying httpie_edgegrid.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
creating dist
creating 'dist\httpie_edgegrid-1.0.2-py2.7.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing httpie_edgegrid-1.0.2-py2.7.egg
creating c:\python27\lib\site-packages\httpie_edgegrid-1.0.2-py2.7.egg
Extracting httpie_edgegrid-1.0.2-py2.7.egg to c:\python27\lib\site-packages
Adding httpie-edgegrid 1.0.2 to easy-install.pth file

Installed c:\python27\lib\site-packages\httpie_edgegrid-1.0.2-py2.7.egg
Processing dependencies for httpie-edgegrid==1.0.2
Searching for pyOpenSSL>=0.13
Reading https://pypi.org/simple/pyOpenSSL/
Downloading https://files.pythonhosted.org/packages/b2/5e/06351ede29fd4899782ad335c2e02f1f862a887c20a3541f17c3fa1a3525/pyOpenSSL-20.0.1-py2.py3-none-any.whl#sha256=818ae18e06922c066f777a33f1fca45786d85edfe71cd043de6379337a7f274b
Best match: pyOpenSSL 20.0.1
Processing pyOpenSSL-20.0.1-py2.py3-none-any.whl
Installing pyOpenSSL-20.0.1-py2.py3-none-any.whl to c:\python27\lib\site-packages
writing requirements to c:\python27\lib\site-packages\pyOpenSSL-20.0.1-py2.7.egg\EGG-INFO\requires.txt
Adding pyOpenSSL 20.0.1 to easy-install.pth file

Installed c:\python27\lib\site-packages\pyopenssl-20.0.1-py2.7.egg
Searching for edgegrid-python>=1.0.9
Reading https://pypi.org/simple/edgegrid-python/
Downloading https://files.pythonhosted.org/packages/a9/57/c96a82d9e14b411bb88c9af2e37ea0590e4e0355c4997225863e2664c936/edgegrid-python-1.1.1.tar.gz#sha256=4825d34fb818d86fbaa3faf3e686b93fa82a1a33b4621d5a8602929c8c9ea5c2
Best match: edgegrid-python 1.1.1
Processing edgegrid-python-1.1.1.tar.gz
Writing c:\users\paul\appdata\local\temp\easy_install-sckpzr\edgegrid-python-1.1.1\setup.cfg
Running edgegrid-python-1.1.1\setup.py -q bdist_egg --dist-dir c:\users\paul\appdata\local\temp\easy_install-sckpzr\edgegrid-python-1.1.1\egg-dist-tmp-htdaga
zip_safe flag not set; analyzing archive contents...
akamai.edgegrid.test.test_edgegrid: module references __file__
creating c:\python27\lib\site-packages\edgegrid_python-1.1.1-py2.7.egg
Extracting edgegrid_python-1.1.1-py2.7.egg to c:\python27\lib\site-packages
Adding edgegrid-python 1.1.1 to easy-install.pth file

Installed c:\python27\lib\site-packages\edgegrid_python-1.1.1-py2.7.egg
Searching for httpie>=0.9.2
Reading https://pypi.org/simple/httpie/
Downloading https://files.pythonhosted.org/packages/b4/d4/712645808103f2d15c281b9eacd184c88754ef7e9a322d9a30ba343fd341/httpie-2.3.0.tar.gz#sha256=d540571991d07329d217c31bf1ff95fd217957da2aa2def09bcfa0c0fca0cf96
Best match: httpie 2.3.0
Processing httpie-2.3.0.tar.gz
Writing c:\users\paul\appdata\local\temp\easy_install-vgq4vz\httpie-2.3.0\setup.cfg
Running httpie-2.3.0\setup.py -q bdist_egg --dist-dir c:\users\paul\appdata\local\temp\easy_install-vgq4vz\httpie-2.3.0\egg-dist-tmp-ccxtyn
Traceback (most recent call last):
  File "setup.py", line 29, in <module>
    'pyOpenSSL >= 0.13'
  File "C:\Python27\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "C:\Python27\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 67, in run
    self.do_egg_install()
  File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 117, in do_egg_install
    cmd.run()
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 418, in run
    self.easy_install(spec, not self.no_deps)
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 660, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 707, in install_item
    self.process_distribution(spec, dist, deps)
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 752, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 782, in resolve
    replace_conflicting=replace_conflicting
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
    return self.obtain(req, installer)
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
    return installer(requirement)
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 679, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 705, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 890, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1158, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1144, in run_setup
    run_setup(setup_script, args)
  File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 253, in run_setup
    raise
  File "C:\Python27\lib\contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "C:\Python27\lib\contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
    yield saved
  File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "C:\Python27\lib\site-packages\setuptools\sandbox.py", line 44, in _execfile
    code = compile(script, filename, 'exec')
  File "c:\users\paul\appdata\local\temp\easy_install-vgq4vz\httpie-2.3.0\setup.py", line 78
    download_url=f'https://github.com/httpie/httpie/archive/{httpie.__version__}.tar.gz',
                                                                                       ^
SyntaxError: invalid syntax

Seems to be pointing to the apostrophe after tar.gz: AkamaiHttpieEdgeGridSyntaxError

aldrichdev commented 3 years ago

Installing this httpie-edgegrid module is part of the Akamai setup steps on this doc: https://developer.akamai.com/api/getting-started

The workaround I used was to test via Postman instead of HTTPie: https://developer.akamai.com/blog/2018/01/10/using-postman-test-akamai-apis

robertolopezlopez commented 3 years ago

@aldrichdev , have you tried the same command but using python3 instead of python2.7?

image
robertolopezlopez commented 2 years ago

Hi @aldrichdev ,

As we have not got any further answer to this issue, I guess that my comment above solved your problem :-) thus I will close the issue. Please reopen it if you would like to add more details.

Regards,

Roberto