Overlaying matplotlib commands on existing Cairo image surface/context

I have a diagram created from a SVG file and loaded in using the cairosvg library. I want to further enhance this diagram with additional overlaid plots defined programatically via direct...

lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

This should be simple so not sure why I am getting the error in the title. SVG created is fine as I have manually checked code to generate svg .... mod_svg =...

Segmentation fault when using `cairo.Region` in Python3 on Fedora 24

I'm trying to get an input shape to apply to a window, so I can have a transparent frame with only the interesting parts to be clickable, etc. I'm using Cairo graphics with PyGObject (Python...

Convert SVG with custom fonts to PNG with Python using cairosvg on Ubuntu

I need to convert SVG with custom fonts into PNG, I’m using the following Python code for this. import cairosvg png = cairosvg.svg2png(bytestring=svg_data) The code works fine on my local...

Can I specify scaling when using the cairosvg module inside of python

The command line version of cairosvg allows scaling. Here is the output of the help function: cairosvg -h usage: cairosvg [-h] [-v] [-f {pdf,png,ps,svg}] [-d DPI] [-W WIDTH] [-H...

Installed cairosvg and cairocffi but gives error on import

When I try to install cairosvg it says requirement satisfied. Requirement already satisfied: cairosvg in c:\users\kshitij\appdata\local\programs\python\python35\lib\site-packages Requirement...

Converting svg to png without changing the pixel values

I have been stuck in this problem for some time now. Essentially, I have a bunch of svg images. Each 'child' in the svg file has been labelled with some pixel value. Currently the number of this...

ModuleNotFoundError: No module named 'CairoSVG'

I have this code: import CairoSVG but I get this: "C:\Program Files\Python36\python.exe" D:/PyCharmProjects/Exyz/Bla.py Traceback (most recent call last): File...

get cairosvg working in windows

Trying to get this code working: import cairosvg import os path = "D:/PyProjects/Bla/Temp" os.chdir(path) cairosvg.svg2pdf(url='Pic.svg', write_to='image.pdf') but get errors along similar to...

ConnectionAbortedError on gevent using flask-socketio

I'm using Flask with flask-socketio and with gevent, working with Windows. The socket are working good but, when i change the page on the client web, on the terminal appears this gevent...

AWS beanstalk deployment failed with exit status 1

I've been trying for several days now to set up Django under Amazon Web Services' Elastic Beanstalk. I am getting a following error most of the time: ERROR: Your requirements.txt is invalid....

KeyError: 'collectstatic' When deploying the Django application to pythonanywhere

During the implementation of my Django application on pythonanywhere for the first time I encountered such an error. Previous applications with a very similar structure were able to be implemented...

500 Internal Server Error in production - Django

I'm very new in django and I am in deploying phase of a project. But after all setup, it shows 500 internal server error and the apache2 error log says ImportError: No module named 'backend' I...

django.core.exceptions.ImproperlyConfigured: WSGI application 'invoice_project.wsgi.application' could not be loaded; Error importing module

I suddenly opened my Django project and when I tried to launch it with py manage.py runserver it gave me this error. django.core.exceptions.ImproperlyConfigured: WSGI application...

How to resolve Cairo and Pango version problems following pip WeasyPrint installation?

I want to run some Python code from the WeasyPrint library on a server running Debian GNU/Linux 8. The code actually appears to be working, except WeasyPrint gives a warning every time the code is...

the JSON object must be str, bytes or bytearray, not 'generator'

I have made a program of scraping data from two url : { "url" : "https://forecast.weather.gov/MapClick.php?lat=37.7772&lon=-122.4168#.XaA9cEZKiUk" , ...

Python extract part of SVG to PNG

I have been doing a ton of searching but cant quite find the answer to this one. I have a series of relatively simple SVG images. I have drawn SVG rectangles over key areas of the images that I am...

ggplot2: CairoSVG changes point size

I build scatterplots using ggplot2 in R. I then want to save them as svg files with Cairo::CairoSVG. It seems to work fine except for the point size, which is enlarged in the resulting .svg...

Heroku worker suddenly crashes, logs don't show any of my scripts. What happened?

I have a flask, gunicorn, postgresql project hosted on heroku and it suddenly failed. I can access the logs, but there is no script that I wrote, so I am confused. I haven't added anything between...

How to convert SVG to BMP in Python

I'm trying to convert svg to bmp, for further processing (custom qr-code) I found that I need to do this: import cairosvg import wx import io png = cairosvg.svg2png(url="test.svg",...

Weasyprint/Cairo loses SVG text labels when converting to PDF

I have an SVG image generated by Bokeh (link here) with labels on the left and bottom of the chart. The image itself shows the text within the chart just fine, however, when converting to PDF...

Load svg image in opencv

I'm trying to download an svg image and open it in opencv for further processing. What I am doing is to convert from svg to png format with cairosvg, open it using Pillow and finally convert to...

Display SVG file in Python

I'm creating a Python3 program that generates SVG images with random circles that I need for a personal project. Right now the program works perfectly, but I'd like to fine-tune some parameters to...

No matching distribution found for django==3.1.1 (from -r requirements.txt (line 23))

i am using ubuntu using terminal i am trying to install python and django i have installed python successfully but when i do pip3 install -r requirements.txt its showing this error :- WARNING:...

Docker build timeouts on AWS Beanstalk for Python app

I have a Python2/Django application running on AWS Beanstalk. I use Dockerfile for deployment. Everything was working fine until I added firebase-admin==3.2.1 dependency to my requirements.txt....

Trouble installing turbodbc

I am attempting to install turbodbc on my Ubuntu 20.10 machine. My specs are as follows: pip 20.2.4, Python 3.8.5 , gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0 I have attempted the solutions provided in...

An unclear requirements.txt error which results in not being able to install

From today, I started getting error while installing modules from requirements.txt, I tried to find the error module and remove it but I couldn't...

Conflicting with version dependencies when running pip install

Having issues with version dependencies when running pip install on docker. However, when installing on my mac without docker and just virtualenv, works perfectly fine. These are the versions I...

How can I use SVGs with pygame (or perhaps display PNGs at a higher definition)?

I'm trying to make a chess opening trainer with Pygame. Graphically, it's incredibly simple; it works like a slideshow, I am only blitting a single image to the screen at a time which updates when...

Pytesseract or Keras OCR to extract text from image

I'm trying to extract text from images. Currently I'm getting empty string as output. Below is my code for pytesseract, although I'm open to Keras OCR also:- from PIL import Image import...