15

I have an existing Django application that I'm trying to set up locally. After creating a virtual environment and installing all the required dependencies, running manage.py just aborts without any other useful error message.

(venv) $ python manage.py
[1]    39973 abort      python manage.py

Any subcommands supplied also just aborts and I've been trying to find a way to debug with no luck.

Versions used:

python 3.6.8
Django 2.0.2

EDIT:

I finally figured out the problem. If you are on macOS 10.15 (Catalina) this may help you:

One of the dependencies is cryptography which requires openssl. You can install openssl via brew then add symbolic links to the following:

cd /usr/local/lib
ln -s /usr/local/Cellar/openssl/1.0.2t/lib/libcrypto.1.0.0.dylib libcrypto.dylib
ln -s /usr/local/Cellar/openssl/1.0.2t/lib/libssl.1.0.0.dylib libssl.dylib
  • this might be an issue in your settings.py file. Perhaps a syntax error or an exception? – gelonida Nov 09 '19 at 01:46
  • Does turning up verbosity tell you anything? `python manage.py --verbosity 3` Also, from your shell snippet, it doesn't look like you have a virtual environment activated. What shell are you using? Are you using `venv` or `virtualenv`? What does `python --version` return, `3.6.8`? What about `pip freeze` output? – FlipperPA Nov 09 '19 at 02:16
  • do you want to run the server ? what do you want to do with manage.py ? – moh80s Nov 09 '19 at 05:34
  • we have several command's with different purposes using manage.py, `python manage.py runserver`===> run's the server. `python manage.py startapp`===> makes an app in the parent folder of your project.what is you'r purpose ? – moh80s Nov 09 '19 at 05:36
  • Adding `--verbosity` option does not do anything. I just want to run migration, but as stated any command for `manage.py` just aborts. I'm guessing this is related to openssl and macOS Catalina. – Marlon Marcos Nov 09 '19 at 07:39
  • Also, I do have a virtual environment activated. Updated the original post to reflect it. – Marlon Marcos Nov 09 '19 at 07:41
  • It is not required to install openssl and it is not a good idea to symlink dylibs in this fashion. cryptography ships a wheel that statically links openssl and if you install via pip (should support back to pip9 but always upgrade to the latest to be safe) then it should install that precompiled wheel. – Paul Kehrer Nov 09 '19 at 12:24
  • @MarlonMarcos, how you figured what was the problem? I am also having the same issue. I tried your solution but no luck. – Abhishek Kumar Nov 25 '19 at 04:22
  • Related: https://stackoverflow.com/questions/58775605/django-running-manage-py-always-aborts – Miguel Zetina Dec 09 '19 at 01:09
  • weird but your edit solution works – user5319825 Dec 13 '19 at 07:28
  • can you explain how you came to your solution? – tamarabyte Jan 07 '20 at 22:58
  • Just confirming that the edit solution worked for me. Thanks! – Soundtemple Jan 28 '20 at 04:50
  • I have the same issue with python 2.7, and the solution posted here doesn't work to me, any idea? – Roberto Fernandez Diaz Apr 06 '20 at 13:56
  • [Here](https://stackoverflow.com/a/59559002/6143954) is the answer the these question. – NKSM Nov 17 '21 at 21:24

3 Answers3

3

Looks like its an issue with asn1crypto package..

running the below command should fix the issue

rm -rf venv/lib/python2.7/site-packages/asn1crypto
Sharan
  • 31
  • 1
  • 6
1

I had similar problem. It is because python3.6.8 and macOS catalina are incompatible. If you upgrade python version at least 3.8, it will work.

https://docs.python.org/3.8/whatsnew/changelog.html?highlight=catalina

jms0707
  • 21
  • 3
0

Just remove cryptography package.

Had a similar problem and found a solution here https://github.com/jazzband/django-push-notifications/issues/549:

Andrii Zarubin
  • 2,165
  • 1
  • 18
  • 31