Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #101534
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Which Python editor has this feature? |
| Date | 2016-01-12 21:18 +1100 |
| Message-ID | <mailman.53.1452593938.13488.python-list@python.org> (permalink) |
| References | (3 earlier) <n716dl$63e$1@ger.gmane.org> <CAPTjJmr5H5EQobXC3XjjdK-UngzSMK44R1Cs5eOyNgUutmhBgQ@mail.gmail.com> <CAERt=-yh6aG6SmiWRdJ5w7Z8-WQZvpXV9X3_ABp=E7mS9N1-Pg@mail.gmail.com> <CAPTjJmpkimm08WkjZssn+nPbCCRd2n1gzUF5TKm5aXs9wusQkw@mail.gmail.com> <n72de2$5vs$1@ger.gmane.org> |
On Tue, Jan 12, 2016 at 7:27 PM, Terry Reedy <tjreedy@udel.edu> wrote:
> On 1/11/2016 8:09 PM, Chris Angelico wrote:
>>
>> On Tue, Jan 12, 2016 at 11:55 AM, Bernardo Sulzbach
>> <mafagafogigante@gmail.com> wrote:
>>>
>>> On Mon, Jan 11, 2016 at 10:14 PM, Chris Angelico <rosuav@gmail.com>
>>> wrote:
>>>>
>>>>
>>>> Next IDLE feature request: Can you make it so that, across all
>>>> platforms, it magically installs PostgreSQL and psycopg2? That would
>>>> solve so many of my students' problems...
>
>
> I detect an invisible smiley at the end of that.
>
> PostgresSQL is not a Python package, hence would need a custom script to
> download and invoke, and would probably need user clicks anyway, at least on
> Windows. Does/could psycopg2 have such for installing its dependency?
>
> Can psycopg2 be installed with pip? There is an issue (#23551) to make a
> pip GUI and make it accessible from IDLE. We need someone with both pip and
> tkinter knowledge to either design and write it or mentor a GSOC student to
> do so. One written, I would add an IDLE menu item to run it, in a separate
> process, just as done now with turtledemo.
Yes, invisible smiley... but with a hint of truth too. Obviously
installing PostgreSQL itself is outside the scope of IDLE, but
psycopg2 is indeed pip-installable... except that it isn't always, on
Windows, because wheels aren't available for all versions. (There's no
Python 3.5 wheel yet; at least, I can't see one on PyPI.) So what I'm
really looking for isn't an IDLE feature but a Python packaging
feature - some people have talked about setting up build farms that
can produce wheels for people.
Hmm. I just tried this, and actually, there's some possibly
low-hanging fruit. (Tested on Python 3.4.3 as 3.5 can't install
psycopg2 anyway.)
>>> import pip; pip.main(["install","psycopg2"])
This produces a rather messy display, because pip.main seems to assume
that writing carriage returns to the console will result in the
display nicely overwriting (producing a moving progress bar as the
file gets downloaded). If IDLE can't handle carriage returns as such,
an easy fix would be to simply display them as complete lines; it
would be more verbose than the normal console behaviour, but not as
ugly.
A couple of other random thoughts from this experiment.
* Going to python.org and pointing the mouse at the download link got
me 3.5.1 32-bit. This is on Google Chrome on a Windows 7 64-bit VM.
* Instead of pip.main(["install","psycopg2"]), I'd like to be able to
say pip.install("psycopg2"). In fact, I might take that to the pip
folks as a suggestion.
* The performance difference between "import pip" on 3.4.3 and 3.5.1
was dramatic! I don't know whether it's CPython that's been sped up or
pip itself, but it's awesome!
There's some kind of issue between pip and Idle that means that
installing a non-wheel blows up with an exception:
Traceback (most recent call last):
File "C:\Users\Rosuav\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\basecommand.py",
line 211, in main
status = self.run(options, args)
File "C:\Users\Rosuav\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\commands\install.py",
line 294, in run
requirement_set.prepare_files(finder)
File "C:\Users\Rosuav\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\req\req_set.py",
line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "C:\Users\Rosuav\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\req\req_set.py",
line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "C:\Users\Rosuav\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\req\req_set.py",
line 505, in _prepare_file
abstract_dist.prep_for_dist()
File "C:\Users\Rosuav\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\req\req_set.py",
line 123, in prep_for_dist
self.req_to_install.run_egg_info()
File "C:\Users\Rosuav\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\req\req_install.py",
line 410, in run_egg_info
command_desc='python setup.py egg_info')
File "C:\Users\Rosuav\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\utils\__init__.py",
line 711, in call_subprocess
line = console_to_str(proc.stdout.readline())
File "C:\Users\Rosuav\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\compat\__init__.py",
line 47, in console_to_str
return s.decode(sys.__stdout__.encoding)
AttributeError: 'NoneType' object has no attribute 'encoding'
Maybe calling pip.main just isn't a supported thing, but it'd be nice
if there were _some_ way to do this, even without a fancy GUI.
How much of this is worth doing anything about, and how much is "hey,
you're hacking around calling a command-line tool from inside a GUI,
and stuff ain't a'gonna work right"?
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Which Python editor has this feature? jfong@ms4.hinet.net - 2016-01-10 17:59 -0800
Re: Which Python editor has this feature? Chris Angelico <rosuav@gmail.com> - 2016-01-11 13:58 +1100
Re: Which Python editor has this feature? jfong@ms4.hinet.net - 2016-01-11 03:04 -0800
Re: Which Python editor has this feature? Terry Reedy <tjreedy@udel.edu> - 2016-01-11 16:21 -0500
Re: Which Python editor has this feature? jfong@ms4.hinet.net - 2016-01-11 17:51 -0800
Re: Which Python editor has this feature? Terry Reedy <tjreedy@udel.edu> - 2016-01-12 02:55 -0500
Re: Which Python editor has this feature? wxjmfauth@gmail.com - 2016-01-12 00:28 -0800
Re: Which Python editor has this feature? jfong@ms4.hinet.net - 2016-01-12 17:27 -0800
Re: Which Python editor has this feature? Chris Angelico <rosuav@gmail.com> - 2016-01-13 12:51 +1100
Re: Which Python editor has this feature? Steven D'Aprano <steve@pearwood.info> - 2016-01-13 13:04 +1100
Re: Which Python editor has this feature? wxjmfauth@gmail.com - 2016-01-13 00:04 -0800
Re: Which Python editor has this feature? wxjmfauth@gmail.com - 2016-01-13 07:24 -0800
Re: Which Python editor has this feature? jfong@ms4.hinet.net - 2016-01-12 17:20 -0800
Re: Which Python editor has this feature? Terry Reedy <tjreedy@udel.edu> - 2016-01-13 04:10 -0500
Re: Which Python editor has this feature? jfong@ms4.hinet.net - 2016-01-13 16:48 -0800
Re: Which Python editor has this feature? Chris Angelico <rosuav@gmail.com> - 2016-01-12 11:14 +1100
Re: Which Python editor has this feature? Bernardo Sulzbach <mafagafogigante@gmail.com> - 2016-01-11 22:55 -0200
Re: Which Python editor has this feature? Grant Edwards <invalid@invalid.invalid> - 2016-01-12 18:31 +0000
Re: Which Python editor has this feature? Chris Angelico <rosuav@gmail.com> - 2016-01-12 12:09 +1100
Re: Which Python editor has this feature? Terry Reedy <tjreedy@udel.edu> - 2016-01-12 03:27 -0500
Re: Which Python editor has this feature? Chris Angelico <rosuav@gmail.com> - 2016-01-12 21:18 +1100
Re: Which Python editor has this feature? Terry Reedy <tjreedy@udel.edu> - 2016-01-13 04:05 -0500
Re: Which Python editor has this feature? Chris Angelico <rosuav@gmail.com> - 2016-01-13 21:09 +1100
Re: Which Python editor has this feature? Tim Chase <python.list@tim.thechases.com> - 2016-01-10 20:37 -0600
Re: Which Python editor has this feature? jfong@ms4.hinet.net - 2016-01-11 03:08 -0800
Re: Which Python editor has this feature? Tim Chase <python.list@tim.thechases.com> - 2016-01-11 05:59 -0600
Re: Which Python editor has this feature? Rustom Mody <rustompmody@gmail.com> - 2016-01-10 19:49 -0800
Re: Which Python editor has this feature? Frank Haun <fh@fhaun.de> - 2016-01-11 11:54 +0000
Re: Which Python editor has this feature? Gordon Levi <gordon@address.invalid> - 2016-01-11 19:40 +1100
Re: Which Python editor has this feature? jfong@ms4.hinet.net - 2016-01-11 03:16 -0800
Re: Which Python editor has this feature? Fabio Zadrozny <fabiofz@gmail.com> - 2016-01-26 16:10 -0200
Re: Which Python editor has this feature? Fabio Zadrozny <fabiofz@gmail.com> - 2016-01-26 16:09 -0200
csiph-web