[issue27090] Python 3 import error after installation

2016-05-23 Thread Ned Deily

Ned Deily added the comment:

To add to Zach's comment, there have been extended discussions in the past 
about whether there should be a separate set of environment variables for 
Python 3 vs Python 2 interpreters; see, for instance, Issue2375 and 
http://comments.gmane.org/gmane.comp.python.devel/109797.  In the latter, Guido 
pronounced on the matter: no separate values for PYTHONPATH since PYTHONPATH is 
not intended to be used on permanent basis.  Either install distribution 
packages normally (to site-packages) or use a virtual environment.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27090] Python 3 import error after installation

2016-05-23 Thread Zachary Ware

Zachary Ware added the comment:

> That seems crazy...

What's crazy about it?  There are very very few legitimate situations where you 
need to permanently set any PYTHON* variable, particularly PYTHONPATH and 
PYTHONHOME.  Adding site-packages to sys.path via PYTHONPATH is completely 
unnecessary anyway since site.py will do that for you in a much safer manner.

This looks like a local configuration issue; closing.

--
nosy: +zach.ware
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27090] Python 3 import error after installation

2016-05-23 Thread Steven D'Aprano

Steven D'Aprano added the comment:

It looks like your Python 3 is somehow using your Python 2 site directory. What 
does your PYTHONPATH contain?

Try running this:

python3 -E -S -c "import sys; print(sys.path)"

and see what it says.

--
nosy: +steven.daprano
type: crash -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27090] Python 3 import error after installation

2016-05-23 Thread Richard Penman

Richard Penman added the comment:

Apparently "The PYTHONPATH variable is used by all versions of Python 2 and 
Python 3, so you should not permanently configure this variable unless it only 
includes code that is compatible with all of your installed Python versions."

That seems crazy...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27090] Python 3 import error after installation

2016-05-23 Thread Richard Penman

Richard Penman added the comment:

The full error log:

$ python3
Failed to import the site module
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/site.py", line 75, in 
__boot()
  File "/usr/local/lib/python2.7/site-packages/site.py", line 23, in __boot
loader.load_module('site')
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site.py", line 
563, in 
main()
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site.py", line 
549, in main
known_paths = addusersitepackages(known_paths)
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site.py", line 
281, in addusersitepackages
user_site = getusersitepackages()
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site.py", line 
257, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site.py", line 
247, in getuserbase
USER_BASE = get_config_var('userbase')
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/sysconfig.py", 
line 582, in get_config_var
return get_config_vars().get(name)
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/sysconfig.py", 
line 561, in get_config_vars
import _osx_support
  File 
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/_osx_support.py",
 line 4, in 
import re
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/re.py", 
line 335, in 
import copyreg
  File "/usr/local/lib/python2.7/site-packages/copyreg/__init__.py", line 7, in 

raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are 
trying to run from the python-future src folder or your installation of 
python-future is corrupted.

What needs to be changed to avoid importing Python 2 modules?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27090] Python 3 import error after installation

2016-05-23 Thread Richard Penman

New submission from Richard Penman:

I installed latest release 
(https://www.python.org/downloads/release/python-351/) on OSX and get this 
error:

$ python3
...
ImportError: This package should not be accessible on Python 3. Either you are 
trying to run from the python-future src folder or your installation of 
python-future is corrupted.

Also tried installing via brew and got same error.

--
components: Installation, Macintosh
messages: 266133
nosy: Richard Penman, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Python 3 import error after installation
type: crash
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com