Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Python Repair is broken #428

Open
1 task
3raxton opened this issue Nov 17, 2024 · 6 comments
Open
1 task

[Bug] Python Repair is broken #428

3raxton opened this issue Nov 17, 2024 · 6 comments
Labels
Bug Something isn't working

Comments

@3raxton
Copy link

3raxton commented Nov 17, 2024

What were you trying to do?

I wanted to clean up my environment with Cork. Upon opening I saw a message that read python is corrupted (I agree and have no idea how to fix it on my machine).

image

What was the problem?

When clicking on the Repair python button, Cork goes through the repair process, eventually telling the user that Python is repaired. However, when closing and then reopening Cork, the message returns (final attached image).

I don't know if this a bug with Cork or more of an issue on my end but whatever it is, Cork cannot seem to repair my issues with Python.

image
image

After reopening Cork post "repair"

image

Error logs

error	22:14:43.122327-0600	Cork	Package URL file:///usr/local/Cellar/python/ has no versions installed
default	22:14:50.256582-0600	Cork	Cached downloads contents: <private>
error	22:14:50.269821-0600	Cork	Could not get proxy host
error	22:14:50.325467-0600	Cork	There was an error decoding the outdated package retrieval output: The data couldn’t be read because it isn’t in the correct format.
Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected end of file" UserInfo={NSDebugDescription=Unexpected end of file})))
default	22:14:53.293845-0600	Cork	Will attempt to place package name
default	22:14:53.535183-0600	Cork	Loader status: false

App Version

1.4.6.1 (85)

App Acquisition

Self-Compiled

Final checklist

  • This report is about the interface, and I included screenshots of the problem
@3raxton 3raxton added the Bug Something isn't working label Nov 17, 2024
@buresdv
Copy link
Owner

buresdv commented Nov 17, 2024

Under the hood, all the repair function does is try to reinstall the package, and in your case, Homebrew itself returned a success, because the sheet didn't show any errors. I think not even Homebrew can fix it for you 😅

That error is thrown when the package folder exists, but there are no versions installed for that package. I'm not surprised python broke like that.

I'd recommend going to /usr/local/Cellar/python/ and seeing if that folder is empty, if it is, do this:

  • Delete that entire folder
  • Reinstall Python, but through the Terminal

If it's not empty, still delete the entire /usr/local/Cellar/python/ folder, and do the above steps

@3raxton
Copy link
Author

3raxton commented Nov 17, 2024 via email

@buresdv
Copy link
Owner

buresdv commented Nov 17, 2024

I meant that you should use brew to reinstall the package 😊

@3raxton
Copy link
Author

3raxton commented Nov 17, 2024 via email

@buresdv
Copy link
Owner

buresdv commented Nov 19, 2024

If you mean you got a folder like [email protected], for example, it means that Homebrew installed a specific locked version. It's confusing, because a package can have two versions:

  • One that's after @
  • A version of a package itself

So, for example you can have a package that's python@3, which means "Python 3", and then, python@3 can have sub-versions, like 3.1 or 3.2. But it will never have a version 2, that would go under python@2

You shouldn't move any of these versions to /usr/local/Cellar/python/, because Homebrew already split the version for you.

I'm not sure how Python works, but what I'd do now is add the python@xxx version to your PATH to activate it.

@3raxton
Copy link
Author

3raxton commented Nov 28, 2024

Thanks for the insight here, I just realized GitHub censored what I tried to share via email. What I was attempting to share was that /usr/local/Cellar/[email protected]/ now exists with the following sentence:

After reinstalling via python, my /usr/local/Cellar/python/ folder remains deleted. However, ***@***.***/ now exists.

All this said, I believe that reinstalling Python, thanks to your support and some Googling (but mostly your support and time), has resolved my errors. When opening Cork, I no longer see the "python is corrupted" alert, which is refreshing, and when running python3 in terminal I have the expected output of a Clang callback with >>>.

Thank you very much for your time and support! I am grateful that newer devs and full stack designers like myself have a tool like Cork to rely on instead of blindly running commands and guessing their way through while hoping for the best, like I did all those years ago.

A quick note that may be helpful for users, when the Package updates with errors alert shows, consider mentioning that when finishing the process in Terminal, a user will have to paste the command that was copied. I had no idea that a command was copied but determined what next steps could be due to my experience. Maybe a button that reads Copy and Finish in Terminal, Copy command and Finish in Terminal or some text below the heading explaining that users will need to paste the copied command into Terminal would be helpful to those with less experience.

image

Thank you for your time, your support, and your guidance; I deeply appreciate it and hope and pray for immense success with Cork!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Status: Ideas
Development

No branches or pull requests

2 participants