How to resolve Failed to create interpreter PyCharm Error


Failed to create interpreter

Executed Command: 
/private/var/folders/jt/54tnc7ts175cs0s37mz7t8580000gn/T/tmppycharm-management/virtualenv.py /Users/code2care/PycharmProjects/pythonProject/venv

Error Occurred:
ERROR: The executable /Users/code2care/PycharmProjects/pythonProject/venv/bin/python is not functioning

Command Output:
New python executable in /Users/code2care/PycharmProjects/pythonProject/venv/bin/python
ERROR: The executable /Users/code2care/PycharmProjects/pythonProject/venv/bin/python is not functioning
ERROR: It thinks sys.prefix is '/private/var/folders/jt/54tnc7ts175cs0s37mz7t8580000gn/T/tmppycharm-management' (should be u'/Users/code2care/PycharmProjects/pythonProject/venv')
ERROR: virtualenv is not compatible with this system or executable
Solution:

You need to update virtualenv package! Run the below command in CMD or Mac/Linux terminal,

pip upgrade virtualenv

If you have pip3, try the below command,

pip3 upgrade virtualenv

If you are using conda, try the below command,

conda install virtualenv

Note: You make have to use sudo command or else you might get access error,

code2care@mac app % sudo pip3 install --upgrade virtualenv
Password:
WARNING: The directory '/Users/code2care/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/code2care/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting virtualenv
  Downloading https://files.pythonhosted.org/packages/91/fb/ca6c071f4231e06a9f0c3bd81c15c233bbacd4a7d9dbb7438d95fece8a1e/virtualenv-20.4.3-py2.py3-none-any.whl (7.2MB)
     |████████████████████████████████| 7.2MB 1.2MB/s 
Requirement already satisfied, skipping upgrade: six<2,>=1.9.0 in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (from virtualenv) (1.15.0)
Collecting filelock<4,>=3.0.0 (from virtualenv)
  Downloading https://files.pythonhosted.org/packages/93/83/71a2ee6158bb9f39a90c0dea1637f81d5eef866e188e1971a1b1ab01a35a/filelock-3.0.12-py3-none-any.whl
Collecting appdirs<2,>=1.4.3 (from virtualenv)
  Downloading https://files.pythonhosted.org/packages/3b/00/2344469e2084fb287c2e0b57b72910309874c3245463acd6cf5e3db69324/appdirs-1.4.4-py2.py3-none-any.whl
Collecting distlib<1,>=0.3.1 (from virtualenv)
  Downloading https://files.pythonhosted.org/packages/f5/0a/490fa011d699bb5a5f3a0cf57de82237f52a6db9d40f33c53b2736c9a1f9/distlib-0.3.1-py2.py3-none-any.whl (335kB)
     |████████████████████████████████| 337kB 3.5MB/s 
Installing collected packages: filelock, appdirs, distlib, virtualenv
Successfully installed appdirs-1.4.4 distlib-0.3.1 filelock-3.0.12 virtualenv-20.4.3
WARNING: You are using pip version 19.2.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Resolve PyCharm Failed to create interpreter error
Resolve PyCharm Failed to create interpreter error





      Topics: Pages | 2015 | Tutorials | Questions | Python