Python3 Django -> HTML to PDF

There are a lot of different ways of generating pdfs from a django webpage in python2. The most clean, probably, is pisa and reportlab. These do not work for python3 though. So far, the only...

Error when importing text from text file to pdf (reportlab, python3)

I have this file: hello.txt, and this file have this text: Hello World and this is my code: from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import A4 c = canvas.Canvas("file.pdf",...

apt-get is broken and can't install anything

My apt-get is totally broken and can't install anything. The output of 'apt-get install -f" is as follows: # apt-get install -f Reading package lists... Done Building dependency tree ...

pip3 install not working - No module named 'pip._vendor.pkg_resources'

When trying to install a package for Python 3 (in Ubuntu), using pip3 install packageName (or sudo pip3 install packageName), I get the following error message: Traceback (most recent call last): ...

pip3 Crashing with Import Error

Python 3.5.2 Ubuntu 16.04 LTS Trying to use pip3 to install some packages and it returns the following regardless of argument: Traceback (most recent call last): File...

Issues with Celery configuration on AWS Elastic Beanstalk - "No config updates to processes"

I've a Django 2 application deployed on AWS Elastic Beanstalk and I'm trying to configure Celery in order to exec async tasks on the same machine. My files: 02_packages.config files: ...

ImportError: No module named 'config.settings'; 'config' is not a package

I'm trying to get my cookiecutter-django app running under Apache with mod_wsgi installed via pip. python3 manager.py runserver works. But after running it in Apache, I got an error saying Module...

Can't `pip3 install -r requirement.txt`

I'm getting dependency error while installing dependency for django project Here is my part of requirement...

SyntaxError: invalid syntax, when starting odoo-bin Odoo 11

Upadate: At the moment Odoo-11.0 is not compatible with Python 3.7.0 I did a source install with odoo version 11.0 on Windows 10. Executing odoo-bin results in a syntax error. Previously it was...

pip3 install works, but then running the python script the module is not found

I'm currently doing pip3 install reportlab and that works fine. However in my script I have a from reportlab.pdfgen import canvas Running my script results in a module reportlab not found. To...

How can i write text to pdf file

I'm using Python3 and I have a long text file and I would like to create a new pdf and write the text inside. I tried using reportlab but it writes only one line. from reportlab.pdfgen pdfgen...

Unable to read chinese character from XML file in Python

Here is my xml <?xml version="1.0" encoding="UTF-16" standalone="no"?> <table rows="3" cols="8" style="" render="1" datatype="2" tabletype="dynamictable1int" primary="" assetClass="Fixed Income"...

python3 reportlab drawImage High to center

c = canvas.Canvas('data.pdf', pagesize= [width*inch,height*inch]) c.drawImage('dataptah',x,y, width,height) c.save() I can't height center the picture, so I need know x and y unit, or put something.

ValueError when installing Odoo 11 on Ubuntu

I'm following this guide. When I use this. sudo pip3 install -r /opt/odoo11/odoo/requirements.txt I get this error: Exception: Traceback (most recent call last): File...

Django Azure upload file to blob storage

I've got an application that needs to upload a file to an Azure Blob Storage container. I've been trying for a very long time and followed every tutorial to no avail. I have installed the...

Odoo 10 - python 3 setup.py install got NameError: name 'execfile' is not defined

I m new to python. I m installing bitnami odoo in my google compute engine VM instance debian linux. as per the below URL I...

Headless LibreOffice or OpenOffice as a PDF report generator?

I hope it’s Ok to post a complete naive question here for LO or OO experts. I’m looking for advice on whether scripting LibreOffice or OpenOffice would be suitable for the following: General...

Uninstall all Python packages in Ubuntu 18.04 having multiple python versions

When I type python and hit tab the following packages are shown python python3 python3.6m python3m python2 python3.6 python3.6m-config ...

Python convert SVGz to PDF: no response

I tried to convert a batch of .svgz into a single pdf file following the instructions of Generating PDFs from SVG input. from svglib.svglib import svg2rlg from reportlab.graphics import...

Cython "ModuleNotFoundError" even though it was just installed via requirements.txt while building docker image

Installing packages when building a docker image via the requirements.txt. In the Dockerfile it reads COPY requirements.txt /app/requirements.txt RUN pip3 install -r /app/requirements.txt In the...

python - cryptography package - import error

I'm working in an Alpine docker container, I'm experiencing the following ImportError while starting a python shell: Traceback (most recent call last): File "manage.py", line 15, in <module> ...

ERROR: Can't roll back Pillow; was not uninstalled

I am trying to install Odoo 13.0 as source installation on Ubuntu 20.04 and running the command to install the dependencies in requirements.txt file results in the following error. Building wheels...

Error with Pillow library when dockerinzing Django app

I develop Django apps in Windows environnement and deploy my apps in production in Linux server. Python 3.8.3 I have a Django project that works (in dev and prod) and I try to "dockerize" it but I...

Unable to deploy app on android phone (reportlab problem)

The app that I was trying to deploy on my phone works well on my desktop PC. I deployed it on my phone using the following command: buildozer android debug deploy run When I tried to run app on...

How to activate virtual envirooment for existing django project using pipenv in python 3.8

I developed a Django webapp project using Django 2.2.1 in python 3.7.2 in a pipenv version 2018.11.26 virtual environment in MacBook Air. After an unintentional update to python 3.8 using brew...

Reportlab installation failed after upgrading to Macos Big Sur

I'm trying to reinstall my virtual env after upgrade to MacOS Big Sur. But error appears: 4 warnings generated. clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic...

OCRmyPDF Error: Failed to fetch http://security.ubuntu.com/

I'm using Google Colab to run my Python codes. Today when I run !apt-get install ocrmypdf -q I get the following "Failed to fetch" error. Any idea why it's showing up and how to fix it?...

Segmentation fault (core dumped) on training the deep neural network /torch/cuda/__init__.py", line 172 in _lazy_init

python3 -q -X faulthandler test.py --model.backbone=resnet18 2021-02-07 20:14:21.198583: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library...

Error when running executable generated by pyinstaller [pyvisa-py]

I'm trying to build an executable from a simple python script using pyvisa-py but I'm running into error after I run the executable generated by pyinstaller. Here what my small python code looks...

Why can't Python 3 virtualenv find some installed packages?

I am working with a Python virtualenv named env to execute Odoo. In the virtualenv bin directory, I got this: pip pip3 pip3.8 python -> /usr/bin/python3 python3 -> python python3.8 ->...