deitz88
deitz88

Reputation: 33

Django to heroku deployment issue

While attempting to deploy my django project, I am running into a strange error:

There is a dependency that I didn't use, and uninstalled, that is still trying to load with requirements.txt during the build.

I have since uninstalled all of the dependencies, removed it from requirements.txt, run makemigrations and migrate, and yet it still tries to load it, which crashes the deployment.

PyGObject is the dependency.

workflow: Procfile - web: gunicorn solarsystem.wsgi ran - pip3 freeze > requirements.txt the dependency is no longer showing after uninstalling it.

however during build:

 Collecting PyGObject
remote:          Downloading PyGObject-3.42.0.tar.gz (716 kB)
remote:          Installing build dependencies: started
remote:          Installing build dependencies: finished with status 'done'
remote:          Getting requirements to build wheel: started
remote:          Getting requirements to build wheel: finished with status 'done'
remote:            Preparing wheel metadata: started
remote:            Preparing wheel metadata: finished with status 'done'
...
 ERROR: Failed building wheel for PyGObject
...
 ERROR: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly

and here is my requirements.txt:

asgiref==3.3.4
autopep8==1.5.7
boto3==1.17.108
botocore==1.20.108
click==8.0.1
cm-rgb==0.3.6
cycler==0.10.0
dj-database-url==0.5.0
Django==3.2.3
django-appconf==1.0.4
django-compressor==2.2
django-heroku==0.3.1
django-libsass==0.9
django-material==1.9.0
django-materializecss-form==1.1.17
django-on-heroku==1.1.2
django-sass-processor==1.0.1
gunicorn==20.1.0
hidapi==0.10.1
Jinja2==3.0.1
jmespath==0.10.0
kiwisolver==1.3.1
libsass==0.21.0
MarkupSafe==2.0.1
matplotlib==3.4.3
mpld3==0.5.5
numpy==1.21.2
Pillow==8.3.1
psutil==5.8.0
psycopg2==2.9.1
psycopg2-binary==2.9.1
pycairo==1.20.1
pycodestyle==2.7.0
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2021.1
PyYAML==5.4.1
rcssmin==1.0.6
rjsmin==1.0.12
s3transfer==0.4.2
six==1.16.0
sqlparse==0.4.1
toml==0.10.2
urllib3==1.26.6
whitenoise==5.3.0

I have tried multiple variations of requirements.txt and Procfile configs, looked all over my source code for any imports of PyGObject or gi, and there are none. I have also searched the PyGObject docs, and other stack overflow resources without success.

to reiterate, I would like to somehow completely remove it in some other fashion, or somehow add an ignore statement somewhere for that dependency so I can successfully deploy.

Upvotes: 0

Views: 138

Answers (1)

hamza_hassan_44
hamza_hassan_44

Reputation: 45

matplotlib uses PyGobject, that's why it tries to install PyGobject when you install requirements.txt file, https://pygobject.readthedocs.io/en/latest/ Try using the following commands. it will probably solve the issue of installing PyGobject

python3 -m pip install --no-use-pep517  cm-rgb

or

sudo pacman -S python cairo pkgconf gobject-introspection gtk3 
pip3 install pycairo to build and install Pycairo
pip3 install PyGObject to build and install PyGObject

Upvotes: 1

Related Questions