Posts

Showing posts with the label Python

Python Virtual Environment | Windows - Linux

In Windows  if you configured the PATH and PATHEXT variables for your Python installation: c:\>python -m venv c:\path\to\myenv In Linux python -m venv /path/to/new/virtual/environment https://www.geeksforgeeks.org/creating-python-virtual-environment-windows-linux/

Use of django.contrib.humanize outside the django template

The humanize can be used in any python files in a Django project by adding the reference Eg: from django.contrib.humanize.template tags.humanize import intcomma no_of_votes = intcomma(total_votes) Ref :https://docs.djangoproject.com/en/4.0/ref/contrib/humanize/

python-docx | docx | No module named 'exceptions'

If the project is using docx as a reference and installed docx package instead of the   python-docx it will lead to following error ModuleNotFoundError: No module named 'exceptions' To fix this error install python-docx and remove docx. pip install python-docx  To install python-docx package Official Documentation available here: https://pypi.org/project/python-docx/ pip uninstall docx To remove installed docx package