Re: Python 3.6 on Windows - does a python3 alias get created by installation?

2019-10-11 Thread Eryk Sun
On 10/11/19, Gisle Vanem  wrote:
>
> An "alias" could also simply be created using:
>doskey python3=f:\ProgramFiles\Python36\python.exe

That's a console alias [1], which gets evaluated by the console host
process (conhost.exe) when the target process does a normal read via
ReadConsoleW or ReadFile. By default doskey.exe creates an alias for
"cmd.exe" processes. In the above case, if you enter a line in CMD's
prompt that starts with "python3" (ignoring initial whitespace), CMD
will instead read "f:\ProgramFiles\Python36\python.exe" from the
console input buffer.

There are obvious limitations. Since it matches at the start of a line
of input, we can't pipe to an alias; or run it on the right-hand side
of the &, &&, or || operators; or use it as a command in a `FOR /f`
loop; or control how it executes via the START command. Also, since
it's only implemented for reads from the current console, it can't be
used as a command in a batch script, i.e. CMD will read "python3" from
the batch file, not "f:\ProgramFiles\Python36\python.exe".

[1] https://docs.microsoft.com/en-us/windows/console/addconsolealias
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.6 on Windows - does a python3 alias get created by installation?

2019-10-11 Thread Gisle Vanem

Eryk Sun wrote:


The simplest way to create a shell link is via the Windows GUI shell,
Explorer. To inherit the working directory of the parent process,
leave the link's "start in" field empty. Also, add ".LNK" to the
system PATHEXT environment variable to allow finding link files
without having to include the ".lnk" file extension, i.e. to be able
to run "python3.lnk <...>" as just "python3 <...>".


An "alias" could also simply be created using:
  doskey python3=f:\ProgramFiles\Python36\python.exe

--
--gv
--
https://mail.python.org/mailman/listinfo/python-list


Re: Odd delays when cwd is on a network mount

2019-10-11 Thread Cameron Simpson

On 12Oct2019 14:04, Greg Ewing  wrote:

Cameron Simpson wrote:

Python's default sys.path includes the current working directory.


Only in an interactive session, where it usually makes sense.


Personally, I would not consider this:

 % python3 -c 'import sys;print(repr(sys.path))'
 ['', '/Users/cameron/lib/python', '/Users/cameron/rc/python', 
 '/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', 
 '/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7', 
 '/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload', 
 '/Users/cameron/var/venv/3.7.1/lib/python3.7/site-packages']


to be interactive. It is at a terminal, but that seems a very low bar.

I see that plain "python filename.py" does not include the current 
directory though.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: question about making an App for Android

2019-10-11 Thread pyotr filipivich
Dennis Lee Bieber  on Fri, 11 Oct 2019 20:05:03
-0400 typed in comp.lang.python  the following:
>
>* To support my practically unused 8" SCT {especially in cloudy Michigan}{I
>also need to find some sort of battery holders that will fit the fork arms
>-- the originals have cracked at the ends and don't make contact}
>
># Started with an interest producing ephemerides for comets -- back when
>Sky&Telescope used to produce element sets for comets [and when it was
>thought comets might be elliptical, parabolic, or hyperbolic -- I think
>modern thought is that they are all elliptical, but may be of such a long
>period that no one would ever prove it]; now they just provide finder
>charts. Also, in a former life I was a programmer at a firm that did
>satellite work -- even if I couldn't follow all the math [one book had
>equations that lost me on page three!] it helped to have some understanding
>of things like perturbations and gravitational models of the earth.

I've been hacking around with what needs to be computed.  As in
"okay,the orbits have different speed at different points on said
ellipse, and so ummm, what does that do to sidereal time?" And so
forth.

And as I've said, "How did they do this without a mechanical
clock?"  I really need to look that part up _first._
>
-- 
pyotr filipivich
Next month's Panel: Graft - Boon or blessing?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Odd delays when cwd is on a network mount

2019-10-11 Thread Eryk Sun
On 10/11/19, Cameron Simpson  wrote:
>
> Python's default sys.path includes the current working directory.
> (Worse: at the front!)

Python normally sets the script directory at the front of sys.path to
allow a script to override site paths and the standard library. If
you're running the REPL, there's no script directory, so the working
directory is used. I think that's fine, but I'd prefer it to use the
absolute path of the working directory at startup instead of
dynamically tracking the current working directory.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 3.7.4 (latest) install changes python to py and removes pip support

2019-10-11 Thread Eryk Sun
On 10/11/19, Jim Elphick  wrote:
> I upgraded my Python 3.7.3 windows install to 3.7.4 using the windows
> download from python.org.
>
> After the install, the keyword "python" will no longer invoke python.
> "python3" also fails.  "py" is now the only access to python.

"python3" would normally fail, unless it's Windows 10 and you
installed the app distribution from the Microsoft Store. Apps execute
via special links that get created in
"%LocalAppData%\Microsoft\WindowsApps". The store distribution of
Python creates a bunch of these links, including versioned names such
as "python3.exe" and "python3.7.exe".

> py -version returns  Python 3.7.4
> python -version returns the following.  The first is bash.
> The second is from powershell
> bash: python: command not found
> python : The term 'python' is not recognized as the name of a cmdlet,

You forgot to include the option to add Python to the environment
variables. This can be fixed in the programs list in the control
panel. Right-click the version that you want to change and select
"change". Choose to modify the installation and click "next". Enable
"add Python to environment variables". Note that this dialog also
shows you where you installed Python in the greyed-out "customize
install location" text box.

The installer probably won't remove invalid paths that no longer work.
So open the system environment variable editor and remove Python
installation directories and "Scripts" subdirectories that are no
longer valid or that you simply don't need in PATH.

For good measure, also select the "Python Launcher" installation and
choose to repair it. This will rewrite the Python.File progid and
registered ".py" file association. That's not enough on its own,
however. "Python.File" is not necessarily your user choice in the
shell, which overrides the registered file association. So, to finish
out, right-click a .py file; select the "open with" menu; and click on
"choose another app". Select the Python app with a rocket in the icon
and enable the toggle to "always use this app". Select ok. This should
ensure that "Python.File" controls the open action and right-click
actions for .py scripts, including the shell extension for
drag-and-drop support and the "Edit with IDLE" menu.

> This is much more than an inconvenience.  Pip has stopped working because it
> expects to find "python.exe".  pipenv also no longer executes.
> Pip -version  returns  (second is again powershell)
> nothing in bash (empty string, no error)
> Fatal error in launcher: Unable to create process using '"c:\program
> files\python37\python.exe"

The new installation was probably not an in-place upgrade but instead
installed somewhere else, probably for the current user in
"%LocalAppData%\Programs\Python\Python37". However files were left in
the original "C:\Program Files\Python37\Scripts" directory, including
a stale pip.exe, which was still in PATH. pip.exe is just a frozen
script that's embedded in a scaled-down version of the py.exe
launcher. The embedded script includes the path to python.exe in a
shebang. That path was no longer valid.

To confirm this in a case like this, run `where.exe pip` to determine
what `pip` executes. You know from the installer where the current
Python installation is located. Or you can determine it by running
Python from the start menu and printing the value of sys.prefix. The
correct pip.exe is in its "Scripts" subdirectory.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Odd delays when cwd is on a network mount

2019-10-11 Thread Gregory Ewing

Cameron Simpson wrote:
Python's default sys.path includes the current working directory.  


Only in an interactive session, where it usually makes sense.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: Odd delays when cwd is on a network mount

2019-10-11 Thread Cameron Simpson

On 11Oct2019 11:06, Tobiah  wrote:

On 10/11/19 10:56 AM, Tobiah wrote:

I have a directory mounted with sshfs over a 5mb connection.
It's quite usable under most circumstances.
When I run python from a directory under that mount, imports from 
local

directories are quite slow:
$ python2.7

import my_module  ##  takes 25 seconds to complete
my_module.__file__
/local/dir/not/on/mount/my_module.py

[...]

Another way:

$ cd ~
$ python2.7

import os
os.chdir('/remote/mount/point')
import my_module## 25 seconds again

my_module.__file__
/local/dir/not/on/mount/my_module.py


Without the os.chdir() the import is instantaneous.


Python's default sys.path includes the current working directory.  
(Worse: at the front!)


So it is loooking for my_module in the sshfs directory before your 
standard places. Thus the slowness.


Personally I consider this a misfeature.

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: sqlalchemy & #temp tables

2019-10-11 Thread Albert-Jan Roskam



On 8 Oct 2019 07:49, Frank Millman  wrote:

On 2019-10-07 5:30 PM, Albert-Jan Roskam wrote:
> Hi,
>
> I am using sqlalchemy (SA) to access a MS SQL Server database (python 3.5, 
> Win 10). I would like to use a temporary table (preferably #local, but 
> ##global would also be an option) to store results of a time-consuming query. 
> In other queries I'd like to access the temporary table again in various 
> places in my Flask app. How do I do that, given that SA closes the connection 
> after each request?
>
> I can do:
> with engine.connect() as con:
>  con.execute('select * into #tmp from tbl')
>  con.execute('select  * from #tmp')
>
> ... but that's limited to the scope of the context manager.
>
> Oh, I don't have rights to create a 'real' table. :-(
>
> Thanks!
>
> Albert-Jan
>


>I do not use SA, but I have written my app to >support Sql Server,
>PostgreSQL and sqlite3 as backend >databases. However, no matter which
>one is in use, I also use sqlite3 as an in->memory database to store
>temporary information.


Hi,

I tried your approach today but I ran into problems due to differences between 
the MS SQL and Sqlite dialect. However, I just came across this page: 
https://docs.sqlalchemy.org/en/13/dialects/sqlite.html#using-temporary-tables-with-sqlite.
 I haven't tried it yey, but using a StaticPool might work.


# maintain the same connection across all threads
from sqlalchemy.pool import StaticPool
engine = create_engine('sqlite:///mydb.db',
poolclass=StaticPool)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: question about making an App for Android

2019-10-11 Thread Eli the Bearded
In comp.lang.python, Dennis Lee Bieber   wrote:
> pyotr filipivich  declaimed the following:
>> "A simple program" to divide the amount of "today's" daylight into 12
>> even '"hours", so that Dawn begins the First hour, the third hour is
>> mid-morning, noon is the middle of the day, the ninth hour mid after
>> noon, and the twelfth hour ends at sunset.  Is simple, no?  {no.}

How antique.

>   Even ignoring "phone" this is anything but simple. It relies upon
> knowing one's latitude and date to allow computing the angle of the sun.

That sounds like one "hard" input, one easy input, and a bunch of
already solved math.

>> But getting from the development environment (the desktop) to the
>> phone is something I am clueless about.
>   Getting anything that is not written in Java onto an Android phone is
> likely going to be a pain. You will most likely need an environment that
> runs on ARM architecture. And I have no idea what iOS requires.

Running Python on Android is trivial. Install Termux:

https://f-droid.org/en/packages/com.termux/

(Or via Google's app store.) Run Termux then type: 

  pkg up
  pkg install python

To read GPS directly from Termux, you'll need Termux:Api which has an
app part and a package part:

https://f-droid.org/en/packages/com.termux.api/

  pkg install termux-api

Then use the shell command `termux-location -p gps -f last`  (or `-f
once`) to get location.

To get the python onto the phone you may wish to install curl or wget or
git and use them to fetch over the network.

For output you could show text in termux or compose a PNG and use
`termux-wallpaper -f`.

I, myself, have just gotten "cron" like functionality in Termux with
Tasker and the Termux:Task plugin. Every five minutes Tasker runs a
shell script that collects data (`termux-sensor`), simplifies the JSON
output (`|jq`) and writes it to a file on my phone.

https://f-droid.org/en/packages/com.termux.tasker/
https://tasker.joaoapps.com/

This happens completely in the background. Using a script like that to
change wallpaper to show solar hours would, I think, be pretty cool.

Elijah
--
has also compiled code (clang) on Termux

-- 
https://mail.python.org/mailman/listinfo/python-list


3.7.4 (latest) install changes python to py and removes pip support

2019-10-11 Thread Jim Elphick
I upgraded my Python 3.7.3 windows install to 3.7.4 using the windows download 
from python.org.

After the install, the keyword "python" will no longer invoke python.  
"python3" also fails.  "py" is now the only access to python.

py -version returns  Python 3.7.4
python -version returns the following.  The first is bash.  The 
second is from powershell
bash: python: command not found
python : The term 'python' is not recognized as the name of a cmdlet, function, 
script file, or operable program.

Previous to the upgrade, "python -version" returned 3.7.3.

This is much more than an inconvenience.  Pip has stopped working because it 
expects to find "python.exe".  pipenv also no longer executes.
Pip -version  returns  (second is again powershell)
nothing in bash (empty string, no error)
Fatal error in launcher: Unable to create process using '"c:\program 
files\python37\python.exe"

Attempting to re-install pip from python fails to help.

I used the installer to completely remove python 3.7.4.  My version reverted to 
3.6.6.  However, the problem with "py" instead of "python" persists.

Attempting to re-install pip (using 3.6.6) through "py -m pip install pip" 
claims "Requirement already satisfied".  But, pip continues to fail.  3.6.6 was 
also installed using download from python.org.

So ... I attempted to re-install 3.7.3 downloaded from python.org.  All of the 
above continues. "python" is no longer available. And pip is no longer 
available.

c:\program files\python37\python.exe does not exist.Also, py.exe does not 
exist in that directory.

I had a similar problem with my MacOS install, but I did not lose access to pip 
and pipenv.

Any help would be appreciated for restoring my python 3.7 install.

Thank you for any help you can provide.

Jim
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: 3.7.4 (latest) install changes python to py and removes pip support

2019-10-11 Thread Jim Elphick
Follow up to previous email.

I was able to get a working version of python 3.7.4 on Windows.

Steps to resolve:


  1.  Uninstalled Python Launcher from my Windows machine
  2.  Uninstalled Python 3.7.3  ( many uninstalls and re-installs)
  3.  Deleted Python37 folder
  4.  Using python installer from python.org, reinstalled using Custom
  5.  Deselected PythonLauncher (i.e. do NOT install Python Launcher).  Kept 
all other options.

Now "python -version" returns python 3.7.4.  And, importantly, I am able to 
access and upgrade pip and pipenv.

Pip still threw an error when I attempted to upgrade to  pip 19.2.3, but it 
actually installed it successfully.  Pipenv upgraded with no issue.

Python is back!

Thank you.

Jim

From: Jim Elphick
Sent: Friday, October 11, 2019 11:03 AM
To: python-list@python.org
Subject: 3.7.4 (latest) install changes python to py and removes pip support

I upgraded my Python 3.7.3 windows install to 3.7.4 using the windows download 
from python.org.

After the install, the keyword "python" will no longer invoke python.  
"python3" also fails.  "py" is now the only access to python.

py -version returns  Python 3.7.4
python -version returns the following.  The first is bash.  The 
second is from powershell
bash: python: command not found
python : The term 'python' is not recognized as the name of a cmdlet, function, 
script file, or operable program.

Previous to the upgrade, "python -version" returned 3.7.3.

This is much more than an inconvenience.  Pip has stopped working because it 
expects to find "python.exe".  pipenv also no longer executes.
Pip -version  returns  (second is again powershell)
nothing in bash (empty string, no error)
Fatal error in launcher: Unable to create process using '"c:\program 
files\python37\python.exe"

Attempting to re-install pip from python fails to help.

I used the installer to completely remove python 3.7.4.  My version reverted to 
3.6.6.  However, the problem with "py" instead of "python" persists.

Attempting to re-install pip (using 3.6.6) through "py -m pip install pip" 
claims "Requirement already satisfied".  But, pip continues to fail.  3.6.6 was 
also installed using download from python.org.

So ... I attempted to re-install 3.7.3 downloaded from python.org.  All of the 
above continues. "python" is no longer available. And pip is no longer 
available.

c:\program files\python37\python.exe does not exist.Also, py.exe does not 
exist in that directory.

I had a similar problem with my MacOS install, but I did not lose access to pip 
and pipenv.

Any help would be appreciated for restoring my python 3.7 install.

Thank you for any help you can provide.

Jim
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Odd delays when cwd is on a network mount

2019-10-11 Thread Tobiah

On 10/11/19 10:56 AM, Tobiah wrote:

I have a directory mounted with sshfs over a 5mb connection.
It's quite usable under most circumstances.

When I run python from a directory under that mount, imports from local
directories are quite slow:

$ python2.7

import my_module  ##  takes 25 seconds to complete
my_module.__file__
/local/dir/not/on/mount/my_module.py


When I do the same thing from my home directory
there is no delay.

$ wc -l /local/dir/not/on/mount/my_module.py
156 /local/dir/not/on/mount/my_module.py

Thanks for any help.


Tobiah





Another way:

$ cd ~
$ python2.7

import os
os.chdir('/remote/mount/point')
import my_module## 25 seconds again

my_module.__file__
/local/dir/not/on/mount/my_module.py



Without the os.chdir() the import is instantaneous.

--
https://mail.python.org/mailman/listinfo/python-list


Odd delays when cwd is on a network mount

2019-10-11 Thread Tobiah

I have a directory mounted with sshfs over a 5mb connection.
It's quite usable under most circumstances.

When I run python from a directory under that mount, imports from local
directories are quite slow:

$ python2.7

import my_module  ##  takes 25 seconds to complete
my_module.__file__
/local/dir/not/on/mount/my_module.py


When I do the same thing from my home directory
there is no delay.

$ wc -l /local/dir/not/on/mount/my_module.py
156 /local/dir/not/on/mount/my_module.py

Thanks for any help.


Tobiah



--
https://mail.python.org/mailman/listinfo/python-list


Re: question about making an App for Android

2019-10-11 Thread Akkana Peck
> pyotr filipivich 
> >"A simple program" to divide the amount of "today's" daylight into 12
> >even '"hours", so that Dawn begins the First hour, the third hour is
> >mid-morning, noon is the middle of the day, the ninth hour mid after
> >noon, and the twelfth hour ends at sunset.  Is simple, no?  {no.}

Dennis Lee Bieber writes:
>   Even ignoring "phone" this is anything but simple. It relies upon
> knowing one's latitude and date to allow computing the angle of the sun.
[Details of some excellent references -- I like Duffett-Smith's
calculator book best for readability).

But if you don't need it to be a phone app, if you use PyEphem, it's
all simple and you don't need to know any of the equations behind
it. So it really depends on your goals and what you want to learn.

> >But getting from the development environment (the desktop) to the
> >phone is something I am clueless about.
> 
>   Getting anything that is not written in Java onto an Android phone is
> likely going to be a pain. You will most likely need an environment that
> runs on ARM architecture. And I have no idea what iOS requires.

For an app with a relatively simple user interface, you can write a
web page in HTML/Javascript and make it installable on both Android
and iOS. Google "Progressive Web App" for details. Although it means
you can't use Python (alas!), it's *much* simpler than dealing with
either an Android Java devkit or a cross-platform setup like Kivy.
I've used PWAs for simple astronomy programs like showing Jupiter's
or Saturn's moons.

...Akkana
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: question about making an App for Android

2019-10-11 Thread pyotr filipivich
Chris Angelico  on Fri, 11 Oct 2019 10:43:53 +1100
typed in comp.lang.python  the following:
>On Fri, Oct 11, 2019 at 10:40 AM pyotr filipivich  wrote:
>> Chris Angelico  on Fri, 11 Oct 2019 09:49:03 +1100
>> typed in comp.lang.python  the following:
>> >On Fri, Oct 11, 2019 at 9:41 AM Dennis Lee Bieber  
>> >wrote:
>> >> On Thu, 10 Oct 2019 08:47:07 -0700, pyotr filipivich 
>> >> 
>> >> declaimed the following:
>> >> >"A simple program" to divide the amount of "today's" daylight into 12
>> >> >even '"hours", so that Dawn begins the First hour, the third hour is
>> >> >mid-morning, noon is the middle of the day, the ninth hour mid after
>> >> >noon, and the twelfth hour ends at sunset.  Is simple, no?  {no.}
>> >> Even ignoring "phone" this is anything but simple. It relies upon
>> >> knowing one's latitude and date to allow computing the angle of the sun.
>> >> And you'll need to handle the fact that above/below arctic/antarctic
>> >> circles you will run into "zeros" where there is either 24 hours of
>> >> daylight or 24 hours of night.
>> >Or maybe it's really simple, because there's an HTTP API that
>> >gives you the information. There's an API for everything these days. A
>> >quick web search showed up this:
>> >https://sunrise-sunset.org/api
>> Thanks.
>> >Which means the project is a matter of taking the data and formatting
>> >it. (Also probably getting lat/long from the phone's location API.)
>> >I'd say this is a good-fun project - a one-week project for a student,
>> >a weekend project for an expert. And yes, there WILL be edge cases to
>> >deal with, but for the most part, it shouldn't be too hard.
>> A one week project for a student. or Longer for a non-student.
>> Oh well, as I say a lot: this wild be easy if I was doing it forty
>> hours a week.  And this part is a spin off of a larger mess, trying to
>> understand how astronomy was done before the invention of mechanical
>> clocks.  I get some off the wall inspirations.
>
>Sure, you can gauge your own skill level to get some idea of an actual
>timeframe.
The programming skills have grown rusty.
>
>I'd recommend starting with a simple non-phone version of the idea,
>and then think about porting it to a phone. That should reduce the
>problem's complexity significantly.

Or I could just "cheat" and make a mechanical clock which does the
same thing.  Maybe not as elaborate as the Japanese Myriad Year clock.
Something along the lines of what Masahiro Kikuno did with his
wristwatch. (18 million Yen, custom fitted to your latitude.)  but
adapted for "western" hours.
The making is "easy", it is the engineering which is hard.
-- 
pyotr filipivich
Next month's Panel: Graft - Boon or blessing?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Error: thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable t

2019-10-11 Thread Rhodri James

On 11/10/2019 15:13, Prabakaran Hadoop wrote:

Thanks for your reply. Any work around or any other way to achieve from python 
to prestosql .


If there is, it'll be in the GitHub issue I linked to.  I just applied 
Google to your question.


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: Curious about library inclusion

2019-10-11 Thread Rhodri James

On 10/10/2019 12:40, Antoon Pardon wrote:

About including piped iterators:
 http://code.activestate.com/recipes/580625-collection-pipeline-in-python/

On 10/10/19 13:00, Paul Moore wrote:

As another measure, look at various other libraries on PyPI and ask
yourself why *this* library needs to be in the stdlib more than those
others. The answer to that question would be a good start for an
argument to include the library.


Well my answer would be that this library wouldn't add functionality
but rather would allow IMO for a more readable coding style.

If you split the work to be done over mulitple generators I find it
easier to understand when I read something like:

 for item in some_file | gen1 | gen2 | gen3:
 ...

than when I read something like:

 for item in gen3(gen2(gen1(somefile))):
 ...


With my ever-so-reactionary hat on, I have to say I'm the other way 
round.  With "gen3(gen2(gen1(somefile)))" it's pretty obvious what's 
going on -- nested function or generator calls, probably the latter from 
the name.  With "somefile|gen1|gen2|gen3" I need more context to kick my 
expectations out of the more common meaning of "|" as "or".


Yes, context demands that the "|" in your first example can't actually 
be an "or".  It still causes a moment of logical disconnect (currently a 
long moment) that throws me out of understanding what your code is doing 
overall into what this line means in particular.  It's exactly like 
coming across an unusual phrasing or iffy grammar in a piece of writing; 
you get thrown out of the reading experience by having to concentrate on 
the individual words.


Heh.  Literary criticism as applied to programming.  Only in Python...

--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: Error: thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable t

2019-10-11 Thread Prabakaran Hadoop


> Rhodri James *-* Kynesim Ltd

Thanks for your reply. Any work around or any other way to achieve from python 
to prestosql . 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Error: thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable t

2019-10-11 Thread Rhodri James

On 11/10/2019 11:27, prabakaranbigd...@gmail.com wrote:

python> conn = hive.Connection(host="xx.xx.xxx.xxx",port=8889,username='hadoop')

C:\Users\Nova15>python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

from pyhive import hive
conn = hive.Connection(host="54.169.219.144",port=8889,username='hadoop')

Traceback (most recent call last):
   File "", line 1, in 
   File 
"c:\users\nova15\appdata\local\programs\python\python37\lib\site-packages\pyhive\hive.py",
 line 192, in __init__
 self._transport.open()
   File 
"c:\users\nova15\appdata\local\programs\python\python37\lib\site-packages\thrift_sasl\__init__.py",
 line 79, in open
 message=("Could not start SASL: %s" % self.sasl.getError()))
thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error 
in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a 
callback: 2'


I am trying to connect from windows 10 local to Prestodb in AWS.



There is an open issue about this on the PyHive GitHub: 
https://github.com/dropbox/PyHive/issues/161


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Suppress tooltips in Pygal charts

2019-10-11 Thread Roy Hann
Following up on Elijah's suggestion responding to my earlier question
about drawing gauges in a mobile (i.e. not normally internet connected)
application on a Raspberry Pi I am using Pygal and rendering to SVG.

I have found no way to stop Pygal from generating SVG that
downloads and invokes JavaScript for various roll-over effects like
tooltips.

Happily the requests to download JS fail fast and silent when there is
no network connection so it is sorta-kinda usable. I am worried
however about when I do have a mobile data connection enabled. I don't
need the tooltips and I don't want the risk of mobile data charges.

Is there any way to tell Pygal not to generate references to on-line
resources?

Roy
-- 
https://mail.python.org/mailman/listinfo/python-list


Error: thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable t

2019-10-11 Thread prabakaranbigdata
python> conn = hive.Connection(host="xx.xx.xxx.xxx",port=8889,username='hadoop')

C:\Users\Nova15>python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyhive import hive
>>> conn = hive.Connection(host="54.169.219.144",port=8889,username='hadoop')
Traceback (most recent call last):
  File "", line 1, in 
  File 
"c:\users\nova15\appdata\local\programs\python\python37\lib\site-packages\pyhive\hive.py",
 line 192, in __init__
self._transport.open()
  File 
"c:\users\nova15\appdata\local\programs\python\python37\lib\site-packages\thrift_sasl\__init__.py",
 line 79, in open
message=("Could not start SASL: %s" % self.sasl.getError()))
thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error 
in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a 
callback: 2'


I am trying to connect from windows 10 local to Prestodb in AWS.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python -m pip install and pip install

2019-10-11 Thread Pankaj Jangid
Chris Angelico  writes:

> ‪On Fri, Oct 11, 2019 at 3:37 PM ‫אורי‬‎  wrote:‬
>>
>> When you upgrade pip, you have to write:
>>
>> python -m pip install --upgrade pip
>>
>> When you install or upgrade anything else, you can write "pip install".
>>
>> You can't upgrade pip using "pip install --upgrade pip".
>>
>
> Only a consideration on Windows. Other platforms are absolutely fine
> upgrading pip either way.
>
Oh! I wasn't aware of this Windows thing. Thanks. 

-- 
Pankaj Jangid
-- 
https://mail.python.org/mailman/listinfo/python-list