5

I'm trying to install the io module in python3.4 or in py 2.7 on my Win10 with

python -m pip install io

in order to use io.StringIO with pycurl but in both cases it says:

   Could not find a version that satisfies the requirement io (from versions: )
   No matching distribution found for io

I actually want to use curl with the GET method to access a https site on spotify
and process the json result...

Any idea?
Thanks

delaflota
  • 159
  • 1
  • 3
  • 12
  • 4
    Why are you trying to *install* `io`? That's a *standard library module*, you don't need to install it, it is already part of Python (from 2.6 onwards). – Martijn Pieters Dec 18 '16 at 12:43

2 Answers2

16

You do not have to explicitly install io. It comes along with python bundle at the time of installing python. Within your code, just do:

import io

and it will work fine

Moinuddin Quadri
  • 46,825
  • 13
  • 96
  • 126
8

The io module is part of Python already. It is in the standard library from Python 2.6 onwards. See the Python 2 and Python 3 versions of the documentation.

In fact, there is no io package on PyPI to install (the link gives a 404 not-found error).

Note that I expect pycurl to write bytestrings, not Unicode text. You probably want to use io.BytesIO instead here. See Pycurl and io.StringIO - pycurl.error: (23, 'Failed writing body) and the PyCurl documentation.

Community
  • 1
  • 1
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343