Running wxPython module on Windows XP? - python

I am trying to run a Python project that uses the wxPython module but the problem is that I don't have any idea why isn't working.
I tried to run it on Windows 10 (School) and it runs fine but when I try to run it at home with my Windows XP it doesn't run. The main problem is that it doesn't say any problem, it just seems to run but it doesn't.
I am using Python 2.7 and I am not running the .exe file from the application I just run the .py file that executes everything. (I did in the same way in both Operating systems)
I have installed wxPython 4.0.2.
Is that I am missing something??
I am new in this, so pls don't be so hard!

Related

Python EXE run failure due to missing DLL's

Good day, everyone!
I made a python script in my Windows 10 laptop that exports sql data into text file. The script was compiled into an executable file via the pyinstaller python package. The exe runs perfectly on my laptop with no issues. However, when I copy/pasted the directory of the exe files in to another laptop (with Windows 7 OS) and run it, errors occur. So, I tried to install python and all the packages I've installed in my laptop to run the script. Yet, the errors remain. Please check the ss of the errors below.
When I run the exe file this pops up
If I click OK, two pop ups appear with the same content
To tell you the truth, this is my first time writing a python script so I may be missing some important details. Please, do explain to me how I can fix these errors. Thank you in advance!
[UPDATE]
I tried to copy/paste the raw python script (pyw) and compiled it to exe on the Windows 7 laptop itself. The error being shown this time when I run the new exe file is "Failed to execute script transfer_out_exporting". No other details are given.
Problem Solved
First, I copied the raw python file (pyw) and compiled it on the Windows 7 laptop itself. This solved the api-ms-win-core dll and python dll issues. Then, I added the read and write files that the exe uses for some data referencing.
The exe was running after doing those steps. I think I was overthinking the problem when I simply had to look at my script. Make sure to always check your script!
Python 3.9 does not seem to be supported on Windows 7 anymore. At least Python 3.7 works on Windows 7 (I don't know about Python 3.8). So, you could compile the program on e.g. Windows 10 within an (anaconda) environment using Python 3.7 and pyinstaller and the resulting compiled program should work on Windows 7.

Run Python script as a Windows service on a non-Python PC

I am looking to run my new Python script as a service. The problem is the users most definitely would not have Python installed. After doing research I found the two main options: nssm and the win32serviceutil code, but as far as I understand both require a Python installation on the PC, since you have to specify the path to your python.exe.
Is there any other way to make a Python script to run as soon as Windows is started and run in the background, which doesn't require an existing Python installation?

Python Running .py File with my Python Anaconda Version

I think I am close to solving my issues but need a little help.
Computer: Mac
My situation: wrote a script in Jupyter Notebooks (.ipynb) and I wanted to run it from IDLE. So I downloaded the .ipynb as a .py file. When I open up the file it opens in Idle and when I go to run the file it says I do not have the module/packages installed.
At the top of the .py file it put #!/usr/bin/env python
When I run which python in my terminal I get /opt/anaconda3/bin/python.
So I am thinking IDLE is running the script through a different environment of python. How do I change it so IDLE will run the script through the python Anaconda also uses?
Thank you!
It is possible that you have more than one python in your OS. Just check the versions in prompt with --version. If you get different python version you need to delete one that you dont use. It is generally the other than anaconda one.

How to make an existing wxPython code run on Mac with conda?

I have an existing wxPython code which runs perfectly on linux and which i want to run on mac. I have the installation through anaconda on both linux and mac.
For mac, i am getting the error "This program needs access to the screen.Please run with a Framework build of python, and only when you are
logged in on the main display of your Mac."
I installed pythonw on through anaconda and I am able to run wx.APP() when running python through the location "/Users/vnigam200/anaconda/bin/pythonw".
I am not sure how to use this location for running my existing script. I tried shebang but it doesn't seem to work.
On Macs you need to run pythonw for wxPython scripts instead of the default, which is python. This is a known problem with Anaconda that they don't seem willing to fix:
https://groups.google.com/a/continuum.io/forum/#!searchin/anaconda/wxpython$20osx/anaconda/-ZAynUQW5HQ/L8AeqfMWNWwJ
https://groups.google.com/a/continuum.io/forum/#!searchin/anaconda/osx$20framework/anaconda/1rX3A1Noi9Q/68MNJWLxupYJ
So basically just do the following in Mac's terminal:
pythonw /path/to/your/script.py
Then it should work fine.

Python script working in IDLE, but not working when run from CMD or Eclipse

I have a rather strange problem.
When I run a python module (which imports other .py and .pyd files) from IDLE or in Debug mode from Eclipse, everything works fine and the final result is correct. But when I try to run the same module in run mode from Eclipse or from CMD, error window appears with 'python.exe has stopped working' message.
I managed to track the error down to the conclusion, that python stops working when a function from .pyd file is called (the import works fine). From there on I have no idea, what in causing the problems.
The .pyd input arguments are in all cases the same. Yet, python crashes, when the python module is run from cmd.
I am running a 64 bit Windows7, 64bit Python 2.6.6 and all python binaries .pyc are obtained on the same computer. No other python version is installed on the computer.
I would appreciate any advice, how to be able to run the code from cmd without python.exe crashing.
I had a similar problem...
this function:
pyd_function(num.asarray(arr).astype('float64'))
was causing problems when I ran it inside eclipse, but not when I debugged it inside eclipse or ran it from IDLE; then I changed the call to:
a=num.asarray(arr).astype('float64')
pyd_function(a)
and it started to work. I could not figure why the first call is causing problems.
I hope this helps you.

Categories

Resources