title: How to upgrade/install a package without pip
body: <p>I have pip2 and pip3 in my environment.</p>
  
  <ul>
  <li><p>pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)</p></li>
  <li><p>pip 18.0 from /usr/local/lib/python3.4/dist-packages/pip (python 3.4)</p></li>
  <li><p>Python 2.7.6</p></li>
  <li><p>Python 3.4.3</p></li>
  </ul>
  
  <p>This is what I'm getting when I try to install (trying to install geopy: <code>pip2 install geopy</code>) or upgrade any package with pip2:</p>
  
  <pre><code>Exception:
  Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
      status = self.run(options, args)
    File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
      requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
    File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1198, in prepare_files
      do_download,
    File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1376, in unpack_url
      self.session,
    File "/usr/lib/python2.7/dist-packages/pip/download.py", line 546, in unpack_http_url
      resp = session.get(target_url, stream=True)
    File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 467, in get
      return self.request('GET', url, **kwargs)
    File "/usr/lib/python2.7/dist-packages/pip/download.py", line 237, in request
      return super(PipSession, self).request(method, url, *args, **kwargs)
    File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 455, in request
      resp = self.send(prep, **send_kwargs)
    File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 558, in send
      r = adapter.send(request, **kwargs)
    File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/adapters.py", line 330, in send
      timeout=timeout
    File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 562, in urlopen
      body=body, headers=headers)
    File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 387, in _make_request
      conn.request(method, url, **httplib_request_kw)
    File "/usr/lib/python2.7/httplib.py", line 1017, in request
      self._send_request(method, url, body, headers)
    File "/usr/lib/python2.7/httplib.py", line 1051, in _send_request
      self.endheaders(body)
    File "/usr/lib/python2.7/httplib.py", line 1013, in endheaders
      self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 864, in _send_output
      self.send(msg)
    File "/usr/lib/python2.7/httplib.py", line 826, in send
      self.connect()
    File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 145, in connect
      match_hostname(self.sock.getpeercert(),
    File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 313, in getpeercert
      for value in get_subj_alt_name(x509)
    File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 94, in get_subj_alt_name
      asn1Spec=general_names)
    File "/usr/local/lib/python2.7/dist-packages/pyasn1/codec/ber/decoder.py", line 825, in __call__
      stGetValueDecoder, self, substrateFun
    File "/usr/local/lib/python2.7/dist-packages/pyasn1/codec/ber/decoder.py", line 391, in valueDecoder
      r.verifySizeSpec()
    File "/usr/local/lib/python2.7/dist-packages/pyasn1/type/base.py", line 252, in verifySizeSpec
      def verifySizeSpec(self): self._sizeSpec(self)
    File "/usr/local/lib/python2.7/dist-packages/pyasn1/type/constraint.py", line 32, in __call__
      '%s failed at: \"%s\"' % (self, sys.exc_info()[1])
  ValueConstraintError: ConstraintsIntersection(ConstraintsIntersection(), ValueSizeConstraint(1, 64)) failed at: "ValueSizeConstraint(1, 64) failed at: "SubjectAltName().setComponents(GeneralName(componentType=NamedTypes(NamedType('otherName', AnotherName(componentType=NamedTypes(Na
  medType('type-id', ObjectIdentifier('&lt;no value&gt;')), NamedType('value', Any(tagSet=TagSet((), Tag(tagClass=128, tagFormat=32, tagId=0))))), ta
  gSet=TagSet((), Tag(tagClass=128, tagFormat=32, tagId=0)))), NamedType('rfc822Name', IA5String(tagSet=TagSet((), Tag(tagClass=128, tagFormat=
  0, tagId=1)))), NamedType('dNSName', IA5String(tagSet=TagSet((), Tag(tagClass=128, tagFormat=0, tagId=2)))), NamedType('directoryName', Name(
  componentType=NamedTypes(NamedType('', RDNSequence())), tagSet=TagSet[...]
  </code></pre>
  
  <p>Full log <a href="https://gist.github.com/anuras/7d7f9570e8ff0688bd278025a635b874" rel="nofollow noreferrer">here</a> (sorry for the gist).</p>
  
  <p>I can't upgrade pip2 (getting the same error as above). I also can't uninstall pip2, as pip2 uninstall pip returns</p>
  
  <blockquote>
    <p>Not uninstalling pip at /usr/lib/python2.7/dist-packages, owned by OS</p>
  </blockquote>
  
  <p>Installing a package from source (<code>python setup.py install</code>) doesn't work either:</p>
  
  <blockquote>
    <p>error in geopy setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.</p>
  </blockquote>
  
  <p>I assume it's because version of setuptools is not being met (and I can't upgrade it via pip, as above). Please suggest me a way out of this mess.</p>