Re: ImportError: cannot import name _remove_dead_weakref

2018-05-03 Thread dieter
Chris Angelico writes: > ... > Somewhere, you have a mismatch of versions. Make sure you're using the > same Python version for everything. You have some Python 2.7 messing > up your 3.5. I have had similar problems. In my case, an active "PYTHONPATH" envvar was responsible -- "unset"ting this en

Re: Weird side effect of default parameter

2018-05-03 Thread Gary Herron
This is a well known feature of Python.   It's a very common "gotcha" to new Python programmers. Google "Mutable default parameters in Python" for long list of explanations and fixes. In short, don't use a mutable object as a default parameter. Gary Herron On 05/03/2018 12:47 PM, python-

Re: ImportError: cannot import name _remove_dead_weakref

2018-05-03 Thread Chris Angelico
On Fri, May 4, 2018 at 6:10 AM, joseph pareti wrote: > please excuse my full python ignorance, however if I set PYTHONPTAH as shown > below, then the results are quite different than before: > > $ echo $PYTHONPATH > /backupdata/anaconda/lib/python2.7/ > $ python tf_train_pressure.py > Fatal Python

Re: ImportError: cannot import name _remove_dead_weakref

2018-05-03 Thread joseph pareti
please excuse my full python ignorance, however if I set PYTHONPTAH as shown below, then the results are quite different than before: $ echo $PYTHONPATH /backupdata/anaconda/lib/python2.7/ $ python tf_train_pressure.py Fatal Python error: Py_Initialize: Unable to get the locale encoding File "/b

Weird side effect of default parameter

2018-05-03 Thread Robert Latest via Python-list
Hello, I don't understand the behavior of the code below. Why does the dict property "a" of both objects contain the same keys? This is only if "a=dict" is in the initializer. If I put self.a = dict() into the init function, I get two separate dicts class Foo(object): def __init__(self, x,

Problems with pip (Windows 10)

2018-05-03 Thread TheSeeker
Dear All, Within the past week I have run into a problem with pip on my work machine (Windows 10, x64, Python 3.6) where pip errors like so: C:\>c:\Python36\Scripts\pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --no-color --default-tim

Re: syntax error (?) on ubuntu

2018-05-03 Thread Ned Batchelder
On 5/3/18 9:11 AM, Joel Goldstick wrote: On Thu, May 3, 2018 at 9:06 AM, joseph pareti wrote: $ python tf_simple.py /anaconda/envs/py35/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. I

Re: ImportError: cannot import name _remove_dead_weakref

2018-05-03 Thread Chris Angelico
On Fri, May 4, 2018 at 1:53 AM, joseph pareti wrote: > on an Ubuntu VM with : > > >1. Linux JP-Paid-UBUNTU-DSVM 4.13.0-1014-azure >2. Python 3.5.4 :: Anaconda custom (64-bit) > > $ manta manta_genSimData.py > Loading script 'manta_genSimData.py' > Traceback (most recent call last): > > ski

ImportError: cannot import name _remove_dead_weakref

2018-05-03 Thread joseph pareti
on an Ubuntu VM with : 1. Linux JP-Paid-UBUNTU-DSVM 4.13.0-1014-azure 2. Python 3.5.4 :: Anaconda custom (64-bit) $ manta manta_genSimData.py Loading script 'manta_genSimData.py' Traceback (most recent call last): skipping some details ... File "/anaconda/lib/python2.7/weakref.py", line

Re: syntax error (?) on ubuntu

2018-05-03 Thread Joel Goldstick
On Thu, May 3, 2018 at 9:06 AM, joseph pareti wrote: > $ python tf_simple.py > > /anaconda/envs/py35/lib/python3.5/site-packages/h5py/__init__.py:36: > FutureWarning: Conversion of the second argument of issubdtype from `float` > to `np.floating` is deprecated. In future, it will be treated as > `

syntax error (?) on ubuntu

2018-05-03 Thread joseph pareti
$ python tf_simple.py /anaconda/envs/py35/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`. from ._conv import registe