Re: python and numpy

2020-04-22 Thread edmondo . giovannozzi
Il giorno martedì 21 aprile 2020 21:04:17 UTC+2, Derek Vladescu ha scritto:
> I’ve just begun a serious study of using Python as an aspiring 
> programmer/data scientist.
> Can someone please walk me through how to download Python, SO THAT I will be 
> able to import numpy?
> 
> Thanks,
> Derek
> 
> Sent from Mail for Windows 10

If you re on Windows have also a look at WinPython.
You can also run it without system installation, in some cases that could be 
nice.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: news.bbs.nz is spewing duplicates to comp.lang.python

2020-04-22 Thread Peter Pearson
On Tue, 21 Apr 2020 21:42:42 + (UTC), Eli the Bearded wrote:
> This just arrived at my newserver:
>
> Path: 
> reader2.panix.com!panix!goblin2!goblin.stu.neva.ru!news.unit0.net!2.eu.feeder.erje.net!4.us.feeder.erje.net!feeder.erje.net!xmission!csiph.com!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail
> From: Eli the Bearded <*@eli.users.panix.com> (Eli the Bearded)
> Newsgroups: comp.lang.python
> Subject: Re: Getting a 401 from requests.get, but not when logging in via 
> the br
> Date: Mon, 20 Apr 2020 19:18:48 +1200
> Organization: fsxNet Usenet Gateway | bbs.nz/#fsxNet
> Message-ID: <[email protected]>
> References: <[email protected]>
> Mime-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> Injection-Info: news.bbs.nz; 
> posting-host="8IWYKlztXHa0+IViEdY46zrq8kpk7dC9fTbT74JiSDQ";
>   logging-data="12595"; mail-complaints-to="[email protected]"
> User-Agent: VSoup v1.2.9.47Beta [95/NT]
> X-Comment-To: dcwhatthe
> X-MailConverter: SoupGate-Win32 v1.05
> Lines: 36
>
> I find that very curious because the post is mine but which I
> sent out with these headers:
>
> Path: reader2.panix.com!panix!qz!not-for-mail
> From: Eli the Bearded <*@eli.users.panix.com>
> Newsgroups: comp.lang.python
> Subject: Re: Getting a 401 from requests.get, but not when logging in via 
> the browser.
> Date: Mon, 20 Apr 2020 19:18:48 + (UTC)
> Organization: Some absurd concept
> Lines: 37
> Message-ID: 
> References: <[email protected]>
> NNTP-Posting-Host: panix5.panix.com
> X-Trace: reader2.panix.com 1587410328 23363 166.84.1.5 (20 Apr 2020 
> 19:18:48 GMT)
> X-Complaints-To: [email protected]
> NNTP-Posting-Date: Mon, 20 Apr 2020 19:18:48 + (UTC)
> X-Liz: It's actually happened, the entire Internet is a massive game of 
> Redcode
> X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix
> X-US-Congress: Moronic Fucks.
> X-Attribution: EtB
> XFrom: is a real address
> Encrypted: double rot-13
> User-Agent: Vectrex rn 2.1 (beta)
>
> The timezone on the date header has changed, the subject has been
> truncated, the Path and injection info is all different, and most
> crucially, the MESSAGE-ID and REFERENCES are completely bogus.
> News servers rely on Message-ID to tell if a message is unique. Change
> it, and it is now a new message. Screwing up References: header while
> changing the Subject: is going to break news threading.
[snip]


Thank you for bringing this up.  I thought I was going crazy.


-- 
To email me, substitute nowhere->runbox, invalid->com.
-- 
https://mail.python.org/mailman/listinfo/python-list


Install GDAL

2020-04-22 Thread J Conrado



Hi,


I'm trying to install GDAL. I used conda and PIP and I didn't have sucess.


I used for pip to insatal GDAL3.0.4:


pip install GDAL


Collecting GDAL
  Using cached GDAL-3.0.4.tar.gz (577 kB)
Building wheels for collected packages: GDAL
  Building wheel for GDAL (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/conrado/anaconda3/bin/python -u -c 'import sys, 
setuptools, tokenize; sys.argv[0] = 
'"'"'/tmp/pip-install-fe1oemj5/GDAL/setup.py'"'"'; 
__file__='"'"'/tmp/pip-install-fe1oemj5/GDAL/setup.py'"'"';f=getattr(tokenize, 
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' 
bdist_wheel -d /tmp/pip-wheel-d230s_n9

   cwd: /tmp/pip-install-fe1oemj5/GDAL/
  Complete output (42 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  copying gdal.py -> build/lib.linux-x86_64-3.7
  copying ogr.py -> build/lib.linux-x86_64-3.7
  copying osr.py -> build/lib.linux-x86_64-3.7
  copying gdalconst.py -> build/lib.linux-x86_64-3.7
  copying gdalnumeric.py -> build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/osgeo
  copying osgeo/osr.py -> build/lib.linux-x86_64-3.7/osgeo
  copying osgeo/gnm.py -> build/lib.linux-x86_64-3.7/osgeo
  copying osgeo/gdal.py -> build/lib.linux-x86_64-3.7/osgeo
  copying osgeo/__init__.py -> build/lib.linux-x86_64-3.7/osgeo
  copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.7/osgeo
  copying osgeo/ogr.py -> build/lib.linux-x86_64-3.7/osgeo
  copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.7/osgeo
  copying osgeo/gdal_array.py -> build/lib.linux-x86_64-3.7/osgeo
  Fixing build/lib.linux-x86_64-3.7/gdal.py 
build/lib.linux-x86_64-3.7/ogr.py build/lib.linux-x86_64-3.7/osr.py 
build/lib.linux-x86_64-3.7/gdalconst.py 
build/lib.linux-x86_64-3.7/gdalnumeric.py 
build/lib.linux-x86_64-3.7/osgeo/osr.py 
build/lib.linux-x86_64-3.7/osgeo/gnm.py 
build/lib.linux-x86_64-3.7/osgeo/gdal.py 
build/lib.linux-x86_64-3.7/osgeo/__init__.py 
build/lib.linux-x86_64-3.7/osgeo/gdalnumeric.py 
build/lib.linux-x86_64-3.7/osgeo/ogr.py 
build/lib.linux-x86_64-3.7/osgeo/gdalconst.py 
build/lib.linux-x86_64-3.7/osgeo/gdal_array.py

  Skipping optional fixer: ws_comma
  Fixing build/lib.linux-x86_64-3.7/gdal.py 
build/lib.linux-x86_64-3.7/ogr.py build/lib.linux-x86_64-3.7/osr.py 
build/lib.linux-x86_64-3.7/gdalconst.py 
build/lib.linux-x86_64-3.7/gdalnumeric.py 
build/lib.linux-x86_64-3.7/osgeo/osr.py 
build/lib.linux-x86_64-3.7/osgeo/gnm.py 
build/lib.linux-x86_64-3.7/osgeo/gdal.py 
build/lib.linux-x86_64-3.7/osgeo/__init__.py 
build/lib.linux-x86_64-3.7/osgeo/gdalnumeric.py 
build/lib.linux-x86_64-3.7/osgeo/ogr.py 
build/lib.linux-x86_64-3.7/osgeo/gdalconst.py 
build/lib.linux-x86_64-3.7/osgeo/gdal_array.py

  Skipping optional fixer: ws_comma
  running build_ext
  gcc -pthread -B /home/conrado/anaconda3/compiler_compat 
-Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg 
-I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps 
-I/home/conrado/anaconda3/include/python3.7m 
-I/home/conrado/anaconda3/lib/python3.7/site-packages/numpy/core/include 
-I/home/conrado/anaconda3/include -c gdal_python_cxx11_test.cpp -o 
gdal_python_cxx11_test.o
  gcc -pthread -B /home/conrado/anaconda3/compiler_compat 
-Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg 
-I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps 
-I/home/conrado/anaconda3/include/python3.7m 
-I/home/conrado/anaconda3/lib/python3.7/site-packages/numpy/core/include 
-I/home/conrado/anaconda3/include -c gdal_python_cxx11_test.cpp -o 
gdal_python_cxx11_test.o -std=c++11

  building 'osgeo._gdal' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/extensions
  gcc -pthread -B /home/conrado/anaconda3/compiler_compat 
-Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg 
-I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps 
-I/home/conrado/anaconda3/include/python3.7m 
-I/home/conrado/anaconda3/lib/python3.7/site-packages/numpy/core/include 
-I/home/conrado/anaconda3/include -c extensions/gdal_wrap.cpp -o 
build/temp.linux-x86_64-3.7/extensions/gdal_wrap.o 
-I/home/conrado/anaconda3/include
  cc1plus: warning: command line option "-Wstrict-prototypes" is valid 
for Ada/C/ObjC but not for C++
  extensions/gdal_wrap.cpp:4075: error: expected constructor, 
destructor, or type conversion before ‘*’ token
  extensions/gdal_wrap.cpp:4123: error: ‘VSIDIR’ was not declared in 
this scope
  extensions/gdal_wrap.cpp:4123: error: ‘dir’ was not declared in this 
scope
  extensions/gdal_wrap.cpp:4124: error: expected ‘,’ or ‘;’ before ‘{’ 
token
  extensions/gdal_wrap.cp

Re: Install GDAL

2020-04-22 Thread Souvik Dutta
This might work.
https://stackoverflow.com/questions/43587960/gdal-installation-error-using-pip/43600989

Souvik flutter dev

On Wed, Apr 22, 2020, 9:52 PM J Conrado  wrote:

>
>
> Hi,
>
>
> I'm trying to install GDAL. I used conda and PIP and I didn't have sucess.
>
>
> I used for pip to insatal GDAL3.0.4:
>
>
> pip install GDAL
>
>
> Collecting GDAL
>Using cached GDAL-3.0.4.tar.gz (577 kB)
> Building wheels for collected packages: GDAL
>Building wheel for GDAL (setup.py) ... error
>ERROR: Command errored out with exit status 1:
> command: /home/conrado/anaconda3/bin/python -u -c 'import sys,
> setuptools, tokenize; sys.argv[0] =
> '"'"'/tmp/pip-install-fe1oemj5/GDAL/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-fe1oemj5/GDAL/setup.py'"'"';f=getattr(tokenize,
>
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> bdist_wheel -d /tmp/pip-wheel-d230s_n9
> cwd: /tmp/pip-install-fe1oemj5/GDAL/
>Complete output (42 lines):
>running bdist_wheel
>running build
>running build_py
>creating build
>creating build/lib.linux-x86_64-3.7
>copying gdal.py -> build/lib.linux-x86_64-3.7
>copying ogr.py -> build/lib.linux-x86_64-3.7
>copying osr.py -> build/lib.linux-x86_64-3.7
>copying gdalconst.py -> build/lib.linux-x86_64-3.7
>copying gdalnumeric.py -> build/lib.linux-x86_64-3.7
>creating build/lib.linux-x86_64-3.7/osgeo
>copying osgeo/osr.py -> build/lib.linux-x86_64-3.7/osgeo
>copying osgeo/gnm.py -> build/lib.linux-x86_64-3.7/osgeo
>copying osgeo/gdal.py -> build/lib.linux-x86_64-3.7/osgeo
>copying osgeo/__init__.py -> build/lib.linux-x86_64-3.7/osgeo
>copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.7/osgeo
>copying osgeo/ogr.py -> build/lib.linux-x86_64-3.7/osgeo
>copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.7/osgeo
>copying osgeo/gdal_array.py -> build/lib.linux-x86_64-3.7/osgeo
>Fixing build/lib.linux-x86_64-3.7/gdal.py
> build/lib.linux-x86_64-3.7/ogr.py build/lib.linux-x86_64-3.7/osr.py
> build/lib.linux-x86_64-3.7/gdalconst.py
> build/lib.linux-x86_64-3.7/gdalnumeric.py
> build/lib.linux-x86_64-3.7/osgeo/osr.py
> build/lib.linux-x86_64-3.7/osgeo/gnm.py
> build/lib.linux-x86_64-3.7/osgeo/gdal.py
> build/lib.linux-x86_64-3.7/osgeo/__init__.py
> build/lib.linux-x86_64-3.7/osgeo/gdalnumeric.py
> build/lib.linux-x86_64-3.7/osgeo/ogr.py
> build/lib.linux-x86_64-3.7/osgeo/gdalconst.py
> build/lib.linux-x86_64-3.7/osgeo/gdal_array.py
>Skipping optional fixer: ws_comma
>Fixing build/lib.linux-x86_64-3.7/gdal.py
> build/lib.linux-x86_64-3.7/ogr.py build/lib.linux-x86_64-3.7/osr.py
> build/lib.linux-x86_64-3.7/gdalconst.py
> build/lib.linux-x86_64-3.7/gdalnumeric.py
> build/lib.linux-x86_64-3.7/osgeo/osr.py
> build/lib.linux-x86_64-3.7/osgeo/gnm.py
> build/lib.linux-x86_64-3.7/osgeo/gdal.py
> build/lib.linux-x86_64-3.7/osgeo/__init__.py
> build/lib.linux-x86_64-3.7/osgeo/gdalnumeric.py
> build/lib.linux-x86_64-3.7/osgeo/ogr.py
> build/lib.linux-x86_64-3.7/osgeo/gdalconst.py
> build/lib.linux-x86_64-3.7/osgeo/gdal_array.py
>Skipping optional fixer: ws_comma
>running build_ext
>gcc -pthread -B /home/conrado/anaconda3/compiler_compat
> -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
> -Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg
> -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps
> -I/home/conrado/anaconda3/include/python3.7m
> -I/home/conrado/anaconda3/lib/python3.7/site-packages/numpy/core/include
> -I/home/conrado/anaconda3/include -c gdal_python_cxx11_test.cpp -o
> gdal_python_cxx11_test.o
>gcc -pthread -B /home/conrado/anaconda3/compiler_compat
> -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
> -Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg
> -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps
> -I/home/conrado/anaconda3/include/python3.7m
> -I/home/conrado/anaconda3/lib/python3.7/site-packages/numpy/core/include
> -I/home/conrado/anaconda3/include -c gdal_python_cxx11_test.cpp -o
> gdal_python_cxx11_test.o -std=c++11
>building 'osgeo._gdal' extension
>creating build/temp.linux-x86_64-3.7
>creating build/temp.linux-x86_64-3.7/extensions
>gcc -pthread -B /home/conrado/anaconda3/compiler_compat
> -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
> -Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg
> -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps
> -I/home/conrado/anaconda3/include/python3.7m
> -I/home/conrado/anaconda3/lib/python3.7/site-packages/numpy/core/include
> -I/home/conrado/anaconda3/include -c extensions/gdal_wrap.cpp -o
> build/temp.linux-x86_64-3.7/extensions/gdal_wrap.o
> -I/home/conrado/anaconda3/include
>cc1plus: warning: command line option "-Wstrict-prototypes" is valid
> for Ada/C/ObjC but not for C++
>extensions/g

Install GDAL

2020-04-22 Thread J Conrado




Hi,

in my question how to install GDAl, I forgot to write that I want to 
install GDAL on Linux. Thanks, Conrado


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


Re: news.bbs.nz is spewing duplicates to comp.lang.python

2020-04-22 Thread Skip Montanaro
> This just arrived at my newserver:
>
...
> I find that very curious because the post is mine but which I
> sent out with these headers:
>
...
> The timezone on the date header has changed, the subject has been
> truncated, the Path and injection info is all different, and most
> crucially, the MESSAGE-ID and REFERENCES are completely bogus.

This news server has caused a number of problems. I think the Python
postmasters have squelched anything coming through mail.python.org
which involves bbs.nz. Most recently, in response to your message, a
filter was added to the gate_news program which drops any messages
from the Usenet world involving "bbs.nz". I'm not sure it will help if
you live solely on the news side of things, though perhaps it will
keep loops between mail and news from developing. I would imagine that
borking the Message-ID header would be one way to generate message
loops.

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


Re: news.bbs.nz is spewing duplicates to comp.lang.python

2020-04-22 Thread Pieter van Oostrum
Skip Montanaro  writes:

>> This just arrived at my newserver:
>>
> ...
>> I find that very curious because the post is mine but which I
>> sent out with these headers:
>>

I filter out these messages in my news setup (using gnus on Emacs) on
the header:

 ("head"
  ("Injection-Info: news.bbs.nz" -1002 nil s))

i.e. each message that contains "news.bbs.nz" in the "Injection-Info"
header will be made invisible.
This solved the problem for me.
-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: news.bbs.nz is spewing duplicates to comp.lang.python

2020-04-22 Thread Skip Montanaro
> I filter out these messages in my news setup (using gnus on Emacs) on
> the header:
>
>  ("head"
>   ("Injection-Info: news.bbs.nz" -1002 nil s))
>
> i.e. each message that contains "news.bbs.nz" in the "Injection-Info"
> header will be made invisible.
> This solved the problem for me.

Thanks. Mark Sapiro was also skeptical that his gate_news config
change would have any effect. His opinion was that it appeared all
problems related to this problem lie on the news side of things. The
resilience of a distributed system is fine for many things, but makes
it difficult to easily squash these sorts of bugs.

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


Re: Install GDAL

2020-04-22 Thread Kushal Kumaran
J Conrado  writes:

> Hi,
>
>
> I'm trying to install GDAL. I used conda and PIP and I didn't have sucess.
>
>
> I used for pip to insatal GDAL3.0.4:
>
>
> pip install GDAL
>
>
> Collecting GDAL
>   Using cached GDAL-3.0.4.tar.gz (577 kB)
>
> 
>
>     cc1plus: warning: command line option "-Wstrict-prototypes" is
> valid for Ada/C/ObjC but not for C++
>     extensions/gdal_wrap.cpp:4075: error: expected constructor,
> destructor, or type conversion before ‘*’ token
>     extensions/gdal_wrap.cpp:4123: error: ‘VSIDIR’ was not declared in
> this scope
>     extensions/gdal_wrap.cpp:4123: error: ‘dir’ was not declared in
> this scope
>     extensions/gdal_wrap.cpp:4124: error: expected ‘,’ or ‘;’ before
> ‘{’ token
>     extensions/gdal_wrap.cpp:3225: warning: ‘char*
> get_aligned_buffer(char*, GDALDataType)’ defined but not used
>     extensions/gdal_wrap.cpp:3244: warning: ‘void
> update_buffer_size(void*, char*, char*, size_t)’ defined but not used
>     extensions/gdal_wrap.cpp:3299: warning: ‘int GetUseExceptions()’
> defined but not used
>     extensions/gdal_wrap.cpp:3305: warning: ‘void UseExceptions()’
> defined but not used
>     extensions/gdal_wrap.cpp:3322: warning: ‘void DontUseExceptions()’
> defined but not used
>     extensions/gdal_wrap.cpp:3370: warning: ‘void ClearErrorState()’
> defined but not used
>     error: command 'gcc' failed with exit status 1

I'd guess you don't have a recent-enough (or maybe too recent? I've not
kept track of C++ changes) version of gcc installed.  Since you're using
anaconda, you can just install the pre-built version provided there by
following the instructions at https://anaconda.org/conda-forge/gdal

-- 
regards,
kushal
-- 
https://mail.python.org/mailman/listinfo/python-list


How does the import machinery handle relative imports?

2020-04-22 Thread Adam Preble
I'm fussing over some details of relative imports while trying to mimic Python 
module loading in my personal project. This is getting more into corner cases, 
but I can spare time to talk about it while working on more normal stuff.

I first found this place:
https://manikos.github.io/how-pythons-import-machinery-works

And eventually just started looking at PEP 451. Neither is really explaining 
relative imports. I decided to try this garbage:

from importlib.util import spec_from_loader, module_from_spec
from importlib.machinery import SourceFileLoader
spec = spec_from_loader("..import_star", 
SourceFileLoader("package_test.import_star", 
r"C:\coding\random_python_projects\package_test\import_star.py"))
print(spec)
mod = module_from_spec(spec)
print(mod)
spec.loader.exec_module(mod)

...exec_module ultimately fails to do the job. Note the syntax so that I can 
actually perform a relative import hahaha:

C:\Python36\python.exe -m package_test.second_level.import_upwards
ModuleSpec(name='..import_star', 
loader=<_frozen_importlib_external.SourceFileLoader object at 
0x0226E914B080>, origin='')
'>
Traceback (most recent call last):
  File "C:\Python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "C:\Python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
  File 
"C:\coding\random_python_projects\package_test\second_level\import_upwards.py", 
line 15, in 
spec.loader.exec_module(mod)
  File "", line 674, in exec_module
  File "", line 750, in get_code
  File "", line 398, in 
_check_name_wrapper
ImportError: loader for package_test.import_star cannot handle ..import_star


Yeah I don't think I'm doing this right! At this point I'm just trying to 
figure out where I feed in the relative path. Is that all deduced in advance of 
creating finding the spec? Can I even give the finders a relative path like 
that?
-- 
https://mail.python.org/mailman/listinfo/python-list