Non-zero exit code (2)

Suddenly PyCharm stopped working properly. While working on Django, first I couldn't create tables, makemigrations and migrate didn't work. Then I tried to create a new project but PyCharm couldn't execute `pip install django` with the following error "Non-zero exit code (2)".

How can I fix this and what is causing it?

Here is the traceback

 

 

Usage:
/Users/rodelaporte/Documents/code/python/djangoProject/venv/bin/python -m pip install [options] <requirement specifier> [package-index-options] ...
/Users/rodelaporte/Documents/code/python/djangoProject/venv/bin/python -m pip install [options] -r <requirements file> [package-index-options] ...
/Users/rodelaporte/Documents/code/python/djangoProject/venv/bin/python -m pip install [options] [-e] <vcs project url> ...
/Users/rodelaporte/Documents/code/python/djangoProject/venv/bin/python -m pip install [options] [-e] <local project path> ...
/Users/rodelaporte/Documents/code/python/djangoProject/venv/bin/python -m pip install [options] <archive url/path> ...

no such option: --build-dir

`

`

0
3 comments

Hi, I had the same problem and this worked for me, the solution was to downgrade pip

https://youtrack.jetbrains.com/issue/PY-45712 

0
Avatar
Permanently deleted user

I met this problem last night. And it shows that it was caused by the update of pip.

I solve it by run "pip install pip==20.2.2", as some say "--build-dir" does not work well in pip 20.3.

Hope this will help you.

 

(later I found pip 20.2.4 also works okay)

1

The fix has been included in 2020.2.5, please feel free to update. 

1

Please sign in to leave a comment.