From virtualenv, pip freeze > requirements.txt give TONES of garbage! How to trim it out?

I'm following this tutorial: http://devcenter.heroku.com/articles/django At some point I'm suposed to do: pip freeze > requirements.txt (Ofc. from virtualenv created instance of python) And I...

webassets + jinja2 bundle error

I am trying to define a Bundle on the fly in a template file using webassets package for python and jinja2 however I keep getting errors: BundleError: '/docroot/static/css/base.css' does not...

cssutils parseString Fails with Media Queries. - ERROR CSSStyleDeclaration: Unexpected token

I am unable to parse CSS strings containing media queries with cssutils.parseString. In the readme for cssutils it clearly states that media queries are supported. How do I do this with...

Pants includes OS X specific Python wheels

TLDR: Pants fetches OS X specific wheels bc I'm developing on Mac. How can I avoid this, or specify that I will deploy to Ubuntu? Full story: Trying to package a Python application with Pants....

Setup Apache2 mod_wsgi for sentry

I already used sentry 8.1 that installed on a virtualenv by below apache configs: <VirtualHost x.x.x.x:80> WSGIDaemonProcess sentry...

numpy asarray float32 works on Ubuntu but not Windows 7

Update Critique would be nice if a downvote is necesarry. Question has been modified since. I followed the instructions here Steps 1 and 2 have been checked. My Intel(R) Core(TM) i7-2860QM CPU @...

PDF/UA Embedded Fonts on OL/UL iText5 xmlworker

I believe this issue will only affect people doing PDF/A or PDF/UA which requires font to be embedded in the document. I am using the XMLWorker with an xhtml document to produce the PDF. If I use...

Scraping font-size from HTML and CSS

I am trying to scrape the font-size of each section of text in an HTML page. I have spent the past few days trying to do it, but I feel like I am trying to re-invent the wheel. I have looked at...

Cant find module Django while deploying on Elastic Beanstalk

I am trying to deploy the backend of this repository https://github.com/LaunchKit/LaunchKit on Elastic Beanstalk. I am very new to Django and I successfully did those two tutorials explaining how...

Python - AttributeError: module 'cssutils' has no attribute 'getUrl'

I am trying to extract URLs from CSS stylesheet using cssutils.getUrls('stylesheet.css') However when I run the code I get an error complaining about 'getUrls' see below. I am running on python...

Python 3.6 cssutils.getUrls error: generator object getUrls

I get a generator object error instead of the css URLs I am trying to extract. Can someone help resolve? >>> import cssutils >>> cssutils.getUrls('http://4nprofessionals.com/css/style.css') ...

How do I use the django-cms Python api to create a page?

I'm trying to write a CMS content migration script that will create our pages for django-cms. However even with the default install of Django-cms, Django-treebeard keeps raising exceptions and...

Raise exception for error logs

I'm using a library that is logging an error. But I'd like it to raise an exception instead. Is there quick way to have an exception raised instead of just an error being logged? The library I'm...

SQLAlchemy - Multiple Foreign key pointing to same table same attribute

My data base structure.... class Person(db.Model): id = db.Column(db.Integer, primary_key=True) user = db.relationship("BankSlip", back_populates="person_user") reference =...

Why does only one of two virtualenvs hit "OpenSSL.SSL.Error: 'PEM routines', 'PEM_read_bio',... 'SSL_CTX_use_PrivateKey_file'..."?

In the process of updating a virtualenv I seem to have gotten things out of whack in the ssl libraries or something. Code that previously worked in either of two virtualenvs now works in only one;...

Extract text from CSS based on font-size

I wrote a function that parses all headers based on header's tags (h1/2...). Now I want to expand on it and add a feature that parses text based on font-size - say either 20px or 1.5em, regardless...

ssl handshake failure using proxy for scrapy

I'm trying to setup a proxy on a scrapy project. I followed te instructions from this answer: "1-Create a new file called “middlewares.py” and save it in your scrapy project and add the...

devstack stack.sh fails because of pip package requirements

I am trying to install OpenStack on Ubuntu-server16.04 using devstack I cloned the stable branch of queens and i have a simple local.conf file when i try to run stack.sh it keeps printing the...

python3 requirements.txt file shows unwanted packages

I created a virtual environment using : python3 -m venv . I then used the command pip freeze requirements.txt to get the list of packages. Below is the content of the file...

get-pip.py error UnboundLocalError: local variable 'result' referenced before assignment

What is wrong here? I am trying to install openstack-ansible and this is look like pip related issue, all i found this in google and not sure its related to my issue or not...

ImportError: cannot import name 'hex_regex'

I'm working on adding django-location-field. However when I add the following code from django.contrib.gis.geos import Point from location_field.models.spatial import LocationField address =...

How can I create a CSS file in python

How can I create a CSS file in python # -*- coding: utf-8 -*- import cssutils css = u'''/* a comment */ .chat { background: #fff; color: white; } .chat-history { ...

vscode python import failure in win10

I have been using Visual Studio Code to develop some python programs. Modules that I import include numpy and cssutils. Sometimes VS CODE asked for upgrade that I usually agreed. Then today, VS...

Calibre not starting under ubuntu 18.04.03 LTS

My calibre is no longer starting and comes up with the following trace: calibre, version 3.21.0 FEHLER: Fehler beim Starten: Es gab einen Fehler beim Starten von calibre. Teile von calibre...

Docker & Python, Speed up when your requirements.pip list is huge?

Say you have a rather large requirements.pip when you modify a requirements.pip, it takes ages to build Docker image because it has to download and install all packages in requirements.pip Is...

Ansible failed to complete because of deprecated Python even though Python 3 is installed

I'm trying to run LaunchKit from google to get some app screenshots. I've gone through all of the steps on the GitHub page (https://github.com/LaunchKit/LaunchKit) for the open source code. After...

Cannot fix django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet

I run the following line of code on a Docker container: RUN python3 manage.py sitetree_resync_apps --settings=sites.production.settings and I get the following error: Traceback (most recent call...

I get 'AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel' when trying to build a Docker image of a python app

I am trying to build a docker image of a python application. It fails with the following error: "Installing build dependencies: finished with status 'done' Getting requirements to build wheel:...

Heroku SSL connection error unsupported protocol

I have been using Heroku for a while to host my Discord bot. It has been connecting to a MySQL database hosted on ClearDB successfully. However, very recently, whenever I use the bot and it tries...

PyTorch RuntimeError: requires_grad_ is not supported on ScriptModules

I'm running Python code from an old repo that seems to no longer work but I can't figure out why or how to fix it. SETUP CODE (Google Colab Notebook) #@title Setup import...