Skip to main content

Posts

Showing posts from April 29, 2019

Internal Server Error + uWsgi + Python (While Updating Ubuntu from 16.04 to 18.04)

When I tried to upgrade my APP server from Ubuntu 16.04 to 18.04 with Python Django application after upgrade Python virtual env is giving the below error for the ./manage.py runserver command. " ImportError: cannot import name _remove_dead_weakref" For solving this error I have done the below fix: cd my-virtualenv-directory virtualenv . --system-site-packages The option --system-site-packages was needed because the application uses python-gtk from Ubuntu. I gues in most other cases it is not needed. Now after that the first error had gone and the below came up: ImportError: /environment-path/virt-env/local/lib/python2.7/site-packages/lxml/etree.so: undefined symbol: PyFPE_jbuf For solving this error I have done the below fix: sudo pip install --upgrade pyOpenSSL cryptography sudo pip uninstall lxml (Optional if needed only lxml is installed) sudo rm -rf /environment-path/virt-env//local/lib/python2.7/site-packages/lxml /environment-path/virt-env//local/li