Trying to install software on a new PC to run Python code I wrote in 2021

  • Thread starter Thread starter Hornbein
  • Start date Start date
  • Tags Tags
    Python
AI Thread Summary
The user is attempting to run Python code from 2021 on a new Windows 11 PC but is facing issues with Anaconda and Spyder, specifically with Spyder failing to connect to the kernel. Despite downloading and reinstalling both Spyder and Python, attempts to execute the code result in crashes or error messages. Suggestions include running Python from the command line to capture error messages and checking environment variables, as the previous setup may differ from the current one. Ultimately, the user has decided that troubleshooting the software is not worth the effort, opting for alternative methods to illustrate their book. The discussion highlights common installation and execution challenges with Python on a new system.
Hornbein
Gold Member
Messages
3,393
Reaction score
2,752
TL;DR Summary
Trying to install software to run Python code I wrote in 2021.
I have some Python code I wrote and ran in 2021. I'm trying to run it again. I have a computer I bought in 2024 running Windows 11.

I used to run under Anaconda. I downloaded that. Attempts to run Spyder, the Python IDE, failed. It wouldn't execute.

So I downloaded Spyder and Python. I was able run Spyder and see my code. But Spyder failed to "connect to the kernel", going into an infinite loop. An Internet search came up with all sorts of different solutions, from rebooting the computer to resetting variables in Anaconda. I tried a number of installs and uninstalls, which incurred some ominous error messages. In the end I was no worse off but Spyder still can't connect to the kernel and execute code. I tried starting Spyder in debug mode : it crashes immediately.

I attempted to execute Python directly from a file. One of those black shell windows would come up for an instant then disappear.

I'm able to start Python from a command line prompt. I don't know how to use it this way. Naturally it doesn't know where any of the files I'm trying to import are.

Any suggestions?
 
Last edited:
Technology news on Phys.org
Hornbein said:
TL;DR Summary: Trying to install software to run Python code I wrote in 2021.

I attempted to execute Python directly from a file. One of those black shell windows would come up for an instant then disappear.
Open the shell window and go to the directory where the file is and then run the command. The window will stay open and you'll be able to see the error message that it probably threw. My guess is that your previous computer had python installed in a different location than your current one and it's looking in the previous location. After that, odds may be good that you don't have one or more python libraries installed on your current machine that the program needs. Either way, the error message in the window should point you in the right direction.
 
  • Like
Likes berkeman, PeterDonis and FactChecker
In addition to what @Borg wrote, make sure that your environment variables are appropriately set. The Python docs at python.org go into some detail about the variables you need to set.
 
Thanks for you help guys. I've decided getting those programs to run again isn't worth it. There are better ways to illustrate my book.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Replies
11
Views
1K
Replies
2
Views
759
Replies
2
Views
2K
Replies
6
Views
2K
Replies
8
Views
2K
Replies
8
Views
1K
Replies
9
Views
1K
Back
Top