ImportError: cannot import name _remove_dead_weakref

Chris Angelico rosuav at gmail.com
Thu May 3 16:13:55 EDT 2018


On Fri, May 4, 2018 at 6:10 AM, joseph pareti <joepareti54 at gmail.com> 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 error: Py_Initialize: Unable to get the locale encoding
>   File "/backupdata/anaconda/lib/python2.7/encodings/__init__.py", line 124
>     raise CodecRegistryError,\
>                             ^
> SyntaxError: invalid syntax
>
> Current thread 0x00007f2b4459f700 (most recent call first):
> Aborted (core dumped)
>

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.

ChrisA



More information about the Python-list mailing list