Ask coding questions

← Back to all posts
Why does automatic installation of packages sometimes fail?
PySimpleGUI (10)

This problem seems to come and go, and it also varies across my different projects, despite the EXACT same import statement is used.

[Almost] ALL of my repl's begin with:
import PySimpleGUI as sg

Usually, or for long stretches of time, repl.it installs the package for me just fine. Other times it complains "PySimpleGUI package not found".

I don't understand why this keeps happening and why it's so intermittent that it would work for 1 project but not another in the same account.

PLEASE help! I love using repl.it to provide quick demonstrations for Reddit responses. It allows me to post code that uses my package without the people examining the code needing to install anything. Repl.it a BRILLIANT piece of work!!!!

-mike

Commentshotnewtop
HarperframeInc (231)

Hi @PySimpleGUI

Repl.it gets their packages from another website called Python Package Index. I believe you are getting this issue because there maybe was something wrong while repl.it was trying to fetch the package, so it may have shown that error.

It does happen to me sometimes, and I can get really frustrated.

Have you tried moving your code to another repl or forking your repl to solve your issue?

I'm sure repl.it is sorry for your inconvenience, and they are doing their best to fix these issues.

Any questions? Please ask me.

PySimpleGUI (10)

@HarperframeInc Aware of PyPI and how it works. Since it's happening to you as well and have an interest in getting it fixed, you can help that process by voting on this bug report:
https://repl.it/bugs/p/python-automatic-package-installs-intermittently-failing

AppliDev (80)

It is a glitch with repl.it and they are trying their best to fix it!

PySimpleGUI (10)

@AppliDev
That's what it felt like. It's SUPER frustrating for it to be intermittent like it is.
What's the timeframe for the fix? I had it happen again just now on a brand new program I started.

AppliDev (80)

@PySimpleGUI Yea! Repl.it are planning on adding something called UPM which is universal package manager so we will only need UPM.

PySimpleGUI (10)

@AppliDev

I thought that just finished that work. Also thought it's a behind the scenes thing that's built-into the backend that does a better job of package management versus something you have to add or turn on.

AppliDev (80)

@PySimpleGUI I don't really know what it is!

PySimpleGUI (10)

@AppliDev Really? Dude, why did you answer?

PaoloAmoroso (69)

I can unfortunately only confirm it happens occasionally and suggest that you file a bug report.

By the way, if you use PySimpleGUI's web version I assume you import PySimpleGUIWeb as sg, right?

PySimpleGUI (10)

@PaoloAmoroso Right, same import as you would on the desktop. Some of my programs here use the web version some use the tkinter version.

PySimpleGUI (10)

@PaoloAmoroso
Thanks very much for the link to file a bug. I filed one. I didn't realize they're voted on:.... so feel free to vote people!

https://repl.it/bugs/p/python-automatic-package-installs-intermittently-failing

PaoloAmoroso (69)

@PySimpleGUI I upovoted your bug report and you may want to encourage your GitHub users who are also Repl.it users to do the same.

ash15khng (292)

You should add a requirements.txt file.
To do that, on the left bar there's a "add file" button. Click that and name the file "requirements.txt" (no inverted commas). Then add the line "PySimpleGUI" (again without quotes)
The module should be loaded when you import it. Hope this helps!

PySimpleGUI (10)

@ash15khng
That's what I don't want to do. Repl.it should be automatically install the latest release.... it's a feature that's broken.

ash15khng (292)

@PySimpleGUI Wait so is the package installing?

PySimpleGUI (10)

@ash15khng Sometimes. Sometimes it does it automatically, sometimes you must manually install which creates the requirements.txt file. A project either does it or it doesn't. I've not been able to "fix" one that's broken.

PySimpleGUI (10)

@ash15khng Can you help out by voting on the bug that was filed so that it gets some attention from Repl.it?
https://repl.it/bugs/p/python-automatic-package-installs-intermittently-failing

PySimpleGUI (10)

@Masy
Is that a known workaround? These are projects I created not someone else's. It seems odd to fork my own project.