Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81758 > unrolled thread

Invalid Syntax Installing pip - ez_setup.py

Started bybillyfurlong@gmail.com
First post2014-12-01 08:58 -0800
Last post2014-12-01 11:09 -0800
Articles 4 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Invalid Syntax Installing pip - ez_setup.py billyfurlong@gmail.com - 2014-12-01 08:58 -0800
    Re: Invalid Syntax Installing pip - ez_setup.py Chris Angelico <rosuav@gmail.com> - 2014-12-02 04:06 +1100
      Re: Invalid Syntax Installing pip - ez_setup.py Billy Furlong <billyfurlong@gmail.com> - 2014-12-01 10:14 -0800
        Re: Invalid Syntax Installing pip - ez_setup.py Billy Furlong <billyfurlong@gmail.com> - 2014-12-01 11:09 -0800

#81758 — Invalid Syntax Installing pip - ez_setup.py

Frombillyfurlong@gmail.com
Date2014-12-01 08:58 -0800
SubjectInvalid Syntax Installing pip - ez_setup.py
Message-ID<b24b1d2e-df53-49ab-86c8-26014c30cb59@googlegroups.com>
Hi all,

Getting an error when I try to install ez_setup.py.  I thought that this was an issues with an incorrect version of python, so I upgraded to 2.7.5 successfully.  But unfortunately I get the same error.


[root@yyboxname tmp]# wget https://bootstrap.pypa.io/ez_setup.py --no-check-certificate -O - | sudo python
--2014-12-01 11:30:17--  https://bootstrap.pypa.io/ez_setup.py
Resolving bootstrap.pypa.io... 23.235.39.175
Connecting to bootstrap.pypa.io|23.235.39.175|:443... connected.
WARNING: certificate common name `*.c.ssl.fastly.net' doesn't match requested host name `bootstrap.pypa.io'.
HTTP request sent, awaiting response... 200 OK
Length: 10476 (10K) [text/x-python]
Saving to: `STDOUT'

100%[=============================================================================>] 10,476      --.-K/s   in 0s

2014-12-01 11:30:17 (31.4 MB/s) - `-' saved [10476/10476]

  File "<stdin>", line 51
    with archive_context(archive_filename):
                       ^
SyntaxError: invalid syntax


Any help or direction would be greatly appreciated.

Billy,

[toc] | [next] | [standalone]


#81759

FromChris Angelico <rosuav@gmail.com>
Date2014-12-02 04:06 +1100
Message-ID<mailman.16456.1417453626.18130.python-list@python.org>
In reply to#81758
On Tue, Dec 2, 2014 at 3:58 AM,  <billyfurlong@gmail.com> wrote:
> Getting an error when I try to install ez_setup.py.  I thought that this was an issues with an incorrect version of python, so I upgraded to 2.7.5 successfully.  But unfortunately I get the same error.
>
>
>   File "<stdin>", line 51
>     with archive_context(archive_filename):
>                        ^
> SyntaxError: invalid syntax

When you run 'python', you apparently are getting the old version
still. Try 'python2.7' instead.

If you used a bash alias to change the meaning of the word 'python',
that won't work with sudo. But the fuller name should work.

ChrisA

[toc] | [prev] | [next] | [standalone]


#81761

FromBilly Furlong <billyfurlong@gmail.com>
Date2014-12-01 10:14 -0800
Message-ID<037a66ca-02f4-4753-ab0d-a008f98faafb@googlegroups.com>
In reply to#81759
Hi Chris,

Yep that got me closer.  I found that using | sudo python2.7 was a bad command.  So I changed over to | python2.7.


[root@myserver tmp]# wget https://bootstrap.pypa.io/ez_setup.py --no-check-certificate -O - | python2.7
--2014-12-01 12:57:07--  https://bootstrap.pypa.io/ez_setup.py
Resolving bootstrap.pypa.io... 23.235.46.175
Connecting to bootstrap.pypa.io|23.235.46.175|:443... connected.
WARNING: certificate common name `*.c.ssl.fastly.net' doesn't match requested host name `bootstrap.pypa.io'.
HTTP request sent, awaiting response... 200 OK
Length: 10476 (10K) [text/x-python]
Saving to: `STDOUT'

100%[=============================================================================================>] 10,476      --.-K/s   in 0s

2014-12-01 12:57:07 (30.8 MB/s) - `-' saved [10476/10476]

Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip
Traceback (most recent call last):
  File "<stdin>", line 332, in <module>
  File "<stdin>", line 327, in main
  File "<stdin>", line 287, in download_setuptools
  File "<stdin>", line 224, in download_file_wget
  File "<stdin>", line 169, in _clean_check
  File "/opt/python2.7/lib/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['wget', 'https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip', '--quiet', '--output-document', '/tmp/setuptools-7.0.zip']' returned non-zero exit status 1

[toc] | [prev] | [next] | [standalone]


#81771

FromBilly Furlong <billyfurlong@gmail.com>
Date2014-12-01 11:09 -0800
Message-ID<da46fa90-5d6d-4f4e-ae88-c07b9d274716@googlegroups.com>
In reply to#81761
Success.

Whats happening is that the second wget command is not recognizing the --no-check-certificate.  So I went around the problem and installed it manually.

wget https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip --no-check-certificate
unzip setuptools-7.0.zip
python2.7 setup.py install
easy_install pip

I'm good.  Pip is installed.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web