I'm running a python script and it used to work (it even does on my other laptop right now) but not on my current computer - I just get the error code:
Process finished with exit code -1073741515 (0xC0000135)
I don't get any other results - not even from "print" commands at the beginning of the file.
I haven't found anything specific to that.
I re-installed python (2.7.9), pygame (1.9.1) and even pycharm (tried 4.5 first, now with 5.0 - same result)
Does anyone know what that error code means? I couldn't find anything about it.
reinstall python – you don't have python33.dll in c:\WINDOWS\system32\
Maybe you have different python versions – look at folders in root of c:
If yes, then point to your version of python.exe in pyCharm > Settings > Project Interpreter
This may be due to another program locking that memory location.
Before you try more drastic measures, know that restarting the computer fixed the problem for me.
The error seems to be related to issues in native code (e.g. C/C++) and might be related to issues in loading some dll file. To know which file, the Windows "Event Viewer" is your friend.
The "Event Viewer" -> "Windows Logs" -> "Application" feed usually shows one or more rows for each crashed application and one of them should list the problematic filename.
Personally I observed similar issue with matplotlib on Python 3.9 (installed using Anaconda on Windows 10). I could see this kind of error when the code was executed using PyCharm. The same code just crashed with no visible errors when starting from Anaconda console.
The Event viewer then showed issue with freetype.dll. In this case, the problem was fixed by downgrading the packege from 2.11.0 to 2.10.4:
conda install freetype=2.10.4
Depending on the exact issue, I could imagine that removing pycache folder might help (like mentioned in other answers). Also, sometimes it might make sense to look at the PATH environment variable to actually understand why certain dll file is loaded from such a location.
I got this error in PyCharm after upgrading pyarrow to the most recent version -- 0.16 --- using pip, running the same code I had ran before this update which used pandas read_parquet specifying the engine="pyarrow" triggering use of this library. After uninstalling and installing the previous version with
pip install pyarrow=="0.15"
the problem resolved.
I encountered the same error when running .py in PyCharm on Windows. Inspired by https://thenewboston.com/forum/topic.php?id=10088, I uninstalled and reinstalled Python. When reinstalling, I checked the ADD PYTHON TO THE PATH Option. After recreating the virtual environment in PyCharm, the error was gone.
Update: On another Windows PC (64-bit), I encountered the same error where reinstalling Python was not enough. I tried two things.
Uninstalling 32-bit Python and installing 64-bit Python. Namely downloading python-3.6.4-amd64.exe instead of python-3.6.4.exe
Recreating the Pycharm project from github.
Between the two actions, the error was gone.
taskkill /F /IM python.exe
Try this if it just happened out of the bloom and it worked normally before that error occurred.
I solved it by disabling "PyQt compatible" checkbox in the Settings under Build, Execution, Deployment --> Python Debugger.
After that, it should debug properly.
Here is caused it and solution:
The computer had two physical processors. The code uses Numba for parallel computations. Upon disabling and re-enabling hyperthreading this issue started. To solve it clear pycache folder and run the program.
I encountered this error in my code as well, in my case the problem was sharing pickle which produced in Unix machine one a Windows one.
**I faced the same situation and the malfunction stems from trying to run both terminal processor and graphical user interfaces. When I clicked the button program stopped running **
Solution: I disabled terminal inputs and work with graphics.
For example:
if you do this
entry1=Entry(root,width=10).pack()
variable= str(input("Whats your name?"))
You will see the error.
if you delete either entry1 or variable, you will not see the problem.
If you're trying create a .svm use dlib probably the problem is in .xml, some image that you use is cause the problem. Try to create a new .xml putting out a image(any image) or remove that your .xml and test, try this even you find out the image problem.
For exemple, the image "treinamento3.jpg" was the problem. I removed this command line:
< image file='delirium\treinamento3.jpg'>
< box top='213' left='86' width='46' height='49'/ >
< box top='531' left='47' width='125' height='123'/ >
< /image >
from my .xml for solve my problem.
Related
I built a python based program. Prior to this project, I have not run a python program from an exe, but I needed to run this project from an exe on a Windows 10 machine. Using pyinstaller I created and tested the final project without issue, but as soon as I set it up on another computer, it returned an "Importing the numpy C-extensions failed" error message. This seemed weird because I did not receive this error on my computer. So I created a clean installation on a VM, and no error. The other system has python installed, but the version is the same as the one I am using on my computer. Regardless of the installed python version, I thought pyinstaller created a stand-alone python environment.
Is there something I should check or compare between the two systems?
Additionally, my system and the VM started the program without a Windows Defender popup, but the problematic system shows a "Windows protected your PC" popup that needs to be bypassed. Is there a Windows defender setting that might be causing this issue?
Thank you to anyone who has information on this issue. I am fairly new to Python and could use any positive advice available.
I have run the program on a clean VM, with no issues. After some research, I tried uninstalling and reinstalling the numpy on the problematic system, but the issue persists. I cannot figure out what is casuing the error on one system but not any others.
[edited!]
Everytime I start Microsoft Visual Code, I get the following alert:
This behavior started a few days ago (after a windows's update). I can select the python interpreter and after that, everything works just fine. From within vscode, I can open a terminal in my virtual environment and I can launch the debugger for django.
The problem is that once I quit vscode, it forgets. Next time I start it up, I have to repeat the process. I have to do it every time.
My environment is:
Windows 11
wsl2
Ubuntu 22.04
pyenv (python 3.9.15 selected)
poetry
I've tried the following:
Researched issue.
Tried Python: Clear Cache
Rollback of Python extension to version 2021-02. Restored to latest.
I'm out of ideas at this point. Is this a configuration issue? Any other ideas on how I can resolve this? This may be an extension issue, but I want to make sure I'm not doing something incorrect with visual code.
Apparently, this was an extension issue. I followed the github link to the python extension project and found a recently closed bug that looked similar. One of the comments suggested I try the pre-release version and my issue is no longer reproducible. Thanks everyone for the help.
https://github.com/microsoft/vscode-python/issues/20644
I know this is a problem that's been asked here before, but I have tried all the solutions I found and not solved it. It's possible I'm not understanding the solutions, but I have tried my best.
I am teaching myself Python and it is slow going, so I don't understand a lot yet. I'm using VSCode as an IDE, Python version 3.10, and Windows 10. I only have the Python extension installed for VSCode. My project files are on a flash drive, D. I replaced a couple folder names with [Default Names] in the text below.
I keep trying to debug/run some code in VSCode and the very first line
import numpy as np
gives me the error
Exception has occurred: ModuleNotFoundError - No module named 'numpy'.
But I know that's not true:
`PS D:\0-Career\Programming\PythonCoding\[ProjectFolder]> py -m pip install numpy
Requirement already satisfied: numpy in c:\users\[UserID]\appdata\local\programs\python\python310\lib\site-packages (1.23.1)`
I tried the solution of going to
environment variables > system variables > "Path" > edit > new >
c:\users\[UserID]\appdata\local\programs\python\python310\
as well as
C:\Users\[UserID]\AppData\Local\Programs\Python\Python310\Lib\site-packages\
and
C:\Users\[UserID]\AppData\Local\Programs\Python\Python310\Scripts\
and I also tried adding a user variable called Python. Nothing appears to have changed as a result of these additions.
Some history if it's helpful:
I first started by installing Python using the Microsoft Store. I used IDLE for a bit, and I used my command line to install pip and numpy. They worked for a little while. I later installed Visual Studio Code IDE. I ultimately have uninstalled the Microsoft Store version and installed the application from the Python site for Windows instead. I have also uninstalled and reinstalled it several times trying to fix my issues, and same for numpy. I also searched my C drive for "python" and burned everything from the past couple days and reinstalled and repaired it out of desperation. No luck.
I have tried to the best of my ability to uninstall everything and reinstall everything to start fresh, because numpy worked ever so briefly early on in IDLE, I think until I had installed the web download version of Python. I don't really understand environment variables, so I'm not sure what I'm doing or if I'm doing that wrong, or what needs to be restarted when I try something new, so it's possible I missed something.
Answers a 10 year old could understand would be appreciated! Or terminology I can easily research for an explanation of how to do it.
Ctrl+Shift+P open Command Palette
choose Python:Select Interpreter
Choose the right interpreter
Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
Also Check 64 bit or 32 bit
Download the latest version
and open the location where you downloaded the NumPy module now press the 'SHIFT' key and press right-click on the mouse then a menu will open where you find open PowerShell. open it now PowerShell window opens in the folder now type pip install and the file name and press the TAB button and click enter. then the NumPy module will be installed.
Have Fun
Try adding the variable PYTHONPATH to your system variables and add the following paths to this variable.
C:\PATH_TO_YOUR_PYTHON_INSTALL
C:\PATH_TO_YOUR_PYTHON_INSTALL\DLLs
C:\PATH_TO_YOUR_PYTHON_INSTALL\Lib
C:\PATH_TO_YOUR_PYTHON_INSTALL\Scripts
It should look something like this.
Screenshot of Environment Variables
After you added the variable restart your VS Code and it should work.
I hope this helps.
I'm running a python script and it used to work (it even does on my other laptop right now) but not on my current computer - I just get the error code:
Process finished with exit code -1073741515 (0xC0000135)
I don't get any other results - not even from "print" commands at the beginning of the file.
I haven't found anything specific to that.
I re-installed python (2.7.9), pygame (1.9.1) and even pycharm (tried 4.5 first, now with 5.0 - same result)
Does anyone know what that error code means? I couldn't find anything about it.
reinstall python – you don't have python33.dll in c:\WINDOWS\system32\
Maybe you have different python versions – look at folders in root of c:
If yes, then point to your version of python.exe in pyCharm > Settings > Project Interpreter
This may be due to another program locking that memory location.
Before you try more drastic measures, know that restarting the computer fixed the problem for me.
The error seems to be related to issues in native code (e.g. C/C++) and might be related to issues in loading some dll file. To know which file, the Windows "Event Viewer" is your friend.
The "Event Viewer" -> "Windows Logs" -> "Application" feed usually shows one or more rows for each crashed application and one of them should list the problematic filename.
Personally I observed similar issue with matplotlib on Python 3.9 (installed using Anaconda on Windows 10). I could see this kind of error when the code was executed using PyCharm. The same code just crashed with no visible errors when starting from Anaconda console.
The Event viewer then showed issue with freetype.dll. In this case, the problem was fixed by downgrading the packege from 2.11.0 to 2.10.4:
conda install freetype=2.10.4
Depending on the exact issue, I could imagine that removing pycache folder might help (like mentioned in other answers). Also, sometimes it might make sense to look at the PATH environment variable to actually understand why certain dll file is loaded from such a location.
I got this error in PyCharm after upgrading pyarrow to the most recent version -- 0.16 --- using pip, running the same code I had ran before this update which used pandas read_parquet specifying the engine="pyarrow" triggering use of this library. After uninstalling and installing the previous version with
pip install pyarrow=="0.15"
the problem resolved.
I encountered the same error when running .py in PyCharm on Windows. Inspired by https://thenewboston.com/forum/topic.php?id=10088, I uninstalled and reinstalled Python. When reinstalling, I checked the ADD PYTHON TO THE PATH Option. After recreating the virtual environment in PyCharm, the error was gone.
Update: On another Windows PC (64-bit), I encountered the same error where reinstalling Python was not enough. I tried two things.
Uninstalling 32-bit Python and installing 64-bit Python. Namely downloading python-3.6.4-amd64.exe instead of python-3.6.4.exe
Recreating the Pycharm project from github.
Between the two actions, the error was gone.
taskkill /F /IM python.exe
Try this if it just happened out of the bloom and it worked normally before that error occurred.
I solved it by disabling "PyQt compatible" checkbox in the Settings under Build, Execution, Deployment --> Python Debugger.
After that, it should debug properly.
Here is caused it and solution:
The computer had two physical processors. The code uses Numba for parallel computations. Upon disabling and re-enabling hyperthreading this issue started. To solve it clear pycache folder and run the program.
I encountered this error in my code as well, in my case the problem was sharing pickle which produced in Unix machine one a Windows one.
**I faced the same situation and the malfunction stems from trying to run both terminal processor and graphical user interfaces. When I clicked the button program stopped running **
Solution: I disabled terminal inputs and work with graphics.
For example:
if you do this
entry1=Entry(root,width=10).pack()
variable= str(input("Whats your name?"))
You will see the error.
if you delete either entry1 or variable, you will not see the problem.
If you're trying create a .svm use dlib probably the problem is in .xml, some image that you use is cause the problem. Try to create a new .xml putting out a image(any image) or remove that your .xml and test, try this even you find out the image problem.
For exemple, the image "treinamento3.jpg" was the problem. I removed this command line:
< image file='delirium\treinamento3.jpg'>
< box top='213' left='86' width='46' height='49'/ >
< box top='531' left='47' width='125' height='123'/ >
< /image >
from my .xml for solve my problem.
Launching a cell will make this message appear: Connecting to kernel: Python 3.9.6 64-bit: Activating Python Environment 'Python 3.9.6 64-bit'. This message will then stay up loading indefinitely, without anything happening. No actual error message.
I've already tried searching for this problem, but every other post seem to obtain at least an error message, which isn't the case here. I still looked at some of these, which seemed to indicate the problem might have come from the traitlets package. I tried to downgrade it to what was recommended, but it didn't solve anything, so I reverted the downgrade.
The main problem here is that I have no idea what could cause such a problem, without even an error message. If you think additional info could help, please do ask, I have no idea what could be of use right now.
Not sure what did the trick but downgrading VSCode to November version and after that reinstalling Jupyter extension worked for me.
i've just found out it's solved by simply just right clicking on code.exe, set to 'run as administrator', and done.
If anyone has the same problem, before reinstalling VSCode as the accepted answer said, try closing and reopening VSCode first.
That worked for me, saving me the agony of having to reinstall VSCode.
I am using mac.os. I moved vscode from the download folder to the application folder. This solved my problem.
On the VSCode download page, there are two Windows installer types: 'User Installer' and 'System Installer'.
I had VSCode installed in AppData folder, using user installer. On the OP's problem occurrence, I tried to restart, reinstall and downgrade VSCode, as other answers suggested, but nothing helped.
Finally, I tried with System Installer. It requires elevated privileges during installation and installs VSCode in Program Files folder. That solved the problem for me.
So, one may try with different installation type.
None of the previous answers are working for me (windows 10 + python 3.10.9 + VSCode x64-1.74.3). What made things work was downgrading VS Code. I arbitrarily chose VSCode x64-1.66.2