Python3 Interpreter Errors

I am trying to add a Python 3 Interpreter in PyCharm so that I can install Django 2.2

I am in the 'Add Python Interpreter' Window

For the 'base interpreter' I have selected /usr/local/bin/python3

The 'Failed to Create Interpreter Window' Pops up with this Error:

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.

Command Output:
Error in sitecustomize; set PYTHONVERBOSE for traceback:
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.
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/packaging_tool.py", line 2, in <module>
import traceback
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/traceback.py", line 3, in <module>
import collections
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/collections/__init__.py", line 27, in <module>
from reprlib import recursive_repr as _recursive_repr
File "/usr/local/lib/python2.7/site-packages/reprlib/__init__.py", line 7, in <module>
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 am I doing wrong? 

1 comment
Comment actions Permalink

Hi,

You're using Python3 as a base interpreter, but there's a path to python2 in the stack trace:

>File "/usr/local/lib/python2.7/site-packages/reprlib/__init__.py", line 7, in <module>

 

There's something wrong with your Python installation, I assume. Maybe you've made some unwanted modifications to PYTHONPATH?

If you're creating new virtualenv, you can try to do that manually first to ensure it's working outside of IDE ("python -m virtualenv <path_to_new_venv>"), then activate it with ("source venv/bin/activate").

If nothing helps, try to completely reinstall python and recreate the interpreter.

0

Please sign in to leave a comment.