What does this error mean? I have trouble googling any docs. The code worked fine and suddenly broke after restarting windows. I looked in the process monitor and the DLL is found and accessed without any permission errors
File "c:\Python27\lib\ctypes\__init__.py", line 435, in __getattr__
dll = self._dlltype(name)
File "c:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 127] The specified procedure could not be found
I have faced the same problem while working with Python 2.7 and this is what I found:
-- Problem was coming because I have installed multiple versions of python (Python3.2, Python3.5 etc).
-- Because of multiple versions, at runtime there was multiple DLLs with same name (in all python versions library). So it was unable to figure out which one to load.
Solution:
-- I have uninstalled all python versions except one I needed (Python2.7) at time. Then run the program and then everything was working fine for me.
- In case someone is figuring a Quick-Fix for again able to download using conda:
I've a exactly same issue while downloading packages using conda install xyz using "CMD" as well as "PowerShell" both. Tried a lot to figure out what was causing problem but couldn't get relevant help. However, just by-chance or hit & trial, I executed the command on "Anaconda PowerShell Prompt" and it worked! Don't know the exact problem but for now I'm ready to go ahead with my packages downloaded :)
This error can be caused if you compile your dll with one name and then change its name afterwards. I don't know why, but this was my problem. If you have changed the name try changing it back to its original name
Problem coming only due to
OSGeo4W and QGIS installation
Uninstall this.
or reinstall with
Select Express Web-GIS Install and click next.
In the ‘Select Packages’ list, ensure that GDAL is selected; MapServer and Apache are also enabled by default, may be unchecked safely.
I encountered the same problem on Win10. After updating python to 3.8 this problem disapeared.
Related
I've got a strange error: as soon as I run OCRmyPDF (inside Python or cmd), my output is stuffed with the following error message:
[WinError 2] The system cannot find the file specified
Even through the "verbosity=True" option in the logger, I get no indication of the origin of the error message (I get this error already when I only import the library). Also, the function does exactly what it is supposed to do and the process completes with exit code 0.
Does anybody know, what could be wrong there?
Best,
Kevin
Please follow the following two steps
Install camelot-py from https://pypi.org/project/camelot-py/.
Then after install Ghostscript from https://www.ghostscript.com/download/gsdnld.html and add in environment variables.
NOTE: Add the following path in computer environment variables
C:\Program Files\gs\gs9.54.0\bin
C:\Program Files\gs\gs9.54.0\lib
Then after restart your computer, then problem fixed.
NOTE: But if you still face an error, make sure you have install ocrmypdf version 12.2.o by command. pip install ocrmypdf==12.2.0
Thank you
The OCRMyPDF library depends heavily on some packages that are not available on windows by default. Tesseract (https://tesseract-ocr.github.io/tessdoc/), GhostScript (https://www.ghostscript.com/) and Unpaper for instance. You need to ensure they are installed and available in your path. Using a package manager like chocolatey can make getting these packages installed a straightforward process.
I try to install virtualenvwrapper-win module,and do:
pip install virtualenvwrapper-win"
It showed the error in the last line:
ERROR: Could not install packages due to an EnvironmentError: [Errno 9] Bad file descriptor
I've completely reinstalled python and updated to latest versions and checked version 64 - bit.
I had the same problem with the installation of gdown package from pip.
screenshot of the error I was getting
But then, I figured out that the actual problem was with my antivirus. Try the following steps -
Open terminal with admin access.
Try disabling your antivirus.
Check Internet connection.
Try restarting your computer.
Any of the above measures should work. Mine had the problem with the antivirus.
Try using pip3 install virtualenvwrapper-win
EnvError and OSerror are brought back when python is not involved, so it is our OS that must present inconsistencies for it (in the processes for example) even if the message returned by python is earlier vague. Here's what I did for me. I just downloaded the iso of my OS, ran it to redo my system. With the option to keep my programs installed I always had the same python error so I had to separate myself from all my installed programs except my drivers and my personal files (music, videos, etc.) managed automatically by this repair mode. If not there's also the Windows Dism tool that could help, well I think, I didn't manage to use it because of its error codes that I found interminable. it allows you to repair windows system files you could know more about it and the method I used on their official website and on other third party sites. When has the cause of this problem, I think it's due to a malware that is installed on your system and that modifies the behavior of your OS, because I had unfortunately installed one on my pc the day the python error appeared. I hope I have helped. My OS is Win 8.1
I have just installed Anaconda 5.3 64-bit (Anaconda3-5.3.0-Windows-x86_64) on Windows 10 and am getting this error when trying to run Spyder.
pythonw.exe - Ordinal Not Found
The ordinal could not be located in the dynamic link library C:\Users\username\Anaconda3\Library\bin\mkl_intel_thread.dll.
I used Dependency Walker to view the functions in the DLL and see that ordinal 242 is there. The function associated with ordinal 242 is mkl_blas_zherk.
Could anyone help me fix this or direct me to a resource to help me figure it out myself?
The quick answer:
set CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1
I set a user environment variable for this.
The official answer is here.
If you are running Python/IPython from a console, check the priority of libiomp5md.dll using where, i.e.:
where libiomp5md.dll
This may show a few absolute paths (one per line) to different libiomp5md.dll files. A healthy setup should list Anaconda's at the top (e.g. C:\ProgramData\Anaconda3\Library\bin\libiomp5md.dll), and if there are any others listed below, they can be ignored as they have lower priority.
However, if you see a different libiomp5md.dll path at the top, then this will be loaded first, and may conflict with Anaconda's DLLs. If this file is in the current directory, then either change directory to a folder without this file, or (if possible) delete or rename the conflicting DLL file. If it's in a different folder, then you may need to re-arrange your PATH variable to move Anaconda's before other paths.
This is not a proper answer, but for me (having the exact same problem) a workaround was to downgrade "anaconda" to 5.2.0 with the Anaconda Navigator. If that works for you, too, you could start upgrading individual packages to see when the error reappears. Maybe it is a bug in one of the packages, not a problem with our systems.
Edit: Here are some links to similar or related discussions:
entry point mkl_blas_dgem2vu could not be located
https://github.com/spyder-ide/spyder/issues/7357
More edit:
It also helped me to find the following files in "C:\Windows\System32" and rename them (I just appended "_renamed" to the file name).
mkl_core.dll
mkl_def.dll
mkl_intel_thread.dll
If I understand correctly, Python will use those instead of the ones in the Anaconda folder, which can cause problems.
['System32\libiomp5md.dll', 'System32\mkl_core.dll',
'System32\mkl_def.dll','System32\mkl_intel_thread.dll',
'SysWOW64\libiomp5md.dll','SysWOW64\mkl_core.dll','SysWOW64\mkl_intel_thread.dll',
'SysWOW64\mkl_p4.dll', 'SysWOW64\mkl_p4m.dll','SysWOW64\mkl_p4m3.dll',
'SysWOW64\mkl_p4p.dll']
Remove all these dll files from C:\Windows\SysWOW64 and C:\Windows\System32
Just do this and restart the spyder once again and hurrrahhhh!!! ur problem will be solved and spyder will open without showing any ordinal 242 error............just do it it is the only solution..
What fixed this issue for me was to uninstall Amplitube and ActiveState Python. I was receiving this exception while using Anaconda prompt and some NLP packages.
I had the same problem and after trying many solutions, including the above, I finally managed to solve it.
First, open command prompt(Administrator) and input:
set CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1
Then, launch the Spyder IDE, always using the command prompt by simply inputting:
spyder
It is important to always launch spyder with the command prompt. If you launch Spyder with the Anaconda Navigator, it will still give you the error message.
Following #Azrael_DD's solution to downgrade to anaconda v5.2.0, you can also do it through a normal console:
conda install anaconda=5.2.0
Another way which Works for me (I deleted all DLL files but the problem continued) was to downgrade ANACONDA to Anaconda3-5.2.0-Windows-x86_64.
I got the installer in this link
Not sure if I am posting in the right place, but I am having problems getting my python GIS programs to work on Windows 7 64 bit. These programs worked on XP 32 bit. I've done a lot of research and tried changing my PythonPath, moving the lib folder, etc and other suggestions. I made a new key in the registry under Python26 as suggested by another with the contents of the Desktop10.pth file. However I am still getting the same error posted below. I am currently running ArcGIS 10.0. I am probably missing something simple! Any help would be greatly appreciated! Thank you in advance.
Traceback (most recent call last):
File "Z:\Desktop\GISClimateMapping.py", line 85, in
import arcpy
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy__init__.py", line
17, in
from geoprocessing import gp
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing__in
it__.py", line 14, in
from _base import *
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing_bas
e.py", line 568, in
env = GPEnvironments(gp)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing_bas
e.py", line 565, in GPEnvironments
return GPEnvironment(geoprocessor)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing_bas
e.py", line 521, in init
self._refresh()
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing_bas
e.py", line 523, in _refresh
envset = (set(env for env in self._gp.listEnvironments()))
RuntimeError: NotInitialized
I had a very similar problem. We have a single licence which, if it's checked out to someone else, prohibits my script from running. I've found this empirically rather than through code/support but I'm fairly confident that's your issue.
You must use Python 2.6 32 bit with Arcgis 10.0, even with a 64 bit OS. I suspect (though not sure from the info provided) that you have another version of Python installed. I would first check to see how many versions are installed, and uninstall all of them except the one at C:\Pytho26\ArcGIS10.0. Then I'd install Python 2.6 (it's on the ArcGIS disk) at the location mentioned. You'll need to re-install numpy and matplotlib too, which are also on the disk. If that does not help, then I'd uninstall ArcGIS and every Python version on your machine, and then re-install ArcGIS. This sounds drastic, but ESRI's Python implementation is pretty sensitive, and you can waste days on trying to find an easy fix. This last step usually works.
I had this very error when the first line of my code was "import arcpy", and the solution for me was to insert a new first line to my python script: "import arcview".
My code was running fine on a system using ArcGIS 10.0, but ran into this problem after I upgraded my development box to 10.1 desktop and server. Various stackoverflow, gisstackexchange, and forums.arcgis.com articles pointed to PATH, PYTHONPATH, HLKM etc environment possibilities or checking your ArcGIS Administrator licensing. After reproducing the problem in both pyscripter and IDLE, confirming everything was as it should be with a properly uninstalled python 2.6, an installed python 2.7 environment, and a valid floating license the error still persisted. My best conjecture for why this fix worked is that perhaps starting with 10.1 arcgis license checkout may be more explicit.
For the record, I just encountered this problem in 10.1 while debugging an arcpy script in Visual Studio. It actually happened between runs with no code changes - one run worked, the next got the error. For whatever reason, adding the import arcview to the top worked. Maybe it is a license checkout issue, but such inconsistency is troubling.
Strange but true.
Had the same problem after upgrading ArcGIS (ArcInfo) 10.1 to 10.2.
Added one line in the python code:
import arcinfo
After this everything worked perfect. Easy to fix, hard to understand.
Thanks!
Willem
I think the problem was created by another user running ArcMap at the same time - since there is a single ArcGIS licence. When the user closed ArcMap in fact, the python script started running well.
This error might occur because your Python is 64-bit and your ArcMap 32-bit.
You can either update your python to a 64-bit version or update you ArcMap to a 64-bit.
How to get a 64-bit version of ArcMap:
From install. When you launch the autorun.exe application, the
startup window wil give you the option of installing ArcGIS Desktop
Background Geoprocessing (64-bit). This is only available in versions
10.1 and above
If you already have ArcGIS Installed in your computer. You can download a patch for the Background Geoprocessing (64-bit) here .
I used to use Python 2.7 and then IDLE was working. I uninstalled it and installed Python 3.1.
Right now Idle cannot launch. What should i do to get it running?
NOTE:
I tried c:\Python31\pythonw.exe c:\Python31\Lib\idlelib\idle.py
i uninstalled 3.1 and installed back 2.7, not working neither...
I got the same problem on window 10. Steps to solve the problem:
Locate the .idlerc folder in your profile directory (e.g. C:\Users\{your-username} without the braces).
Delete the .idlerc directory.
It worked for me...
In the past, I've often found that when I had some issues with the python.org version of some Python release, specifically on Windows, installing instead the activepython version of the same release, from ActiveState, made the problems go away. So, in your shoes, the first thing I would try would be ActivePython (I don't think they have a 2.7 yet -- it's probably been around for too short a time yet -- but they definitely do have a 3.1).
EDIT: Versions 2.5, 2.6, 2.7, 3.2, 3.3, and 3.4 have been added.
I too faced the same problem. But at last solved like this -->
Run Python\Lib\idlelib\idle.py as admin, i got the error that the file "recent-files.lst" can't be opened.
So go to your home folder, show hidden files, click on .idlerc and delete the file named "recent-files". Now IDLE is working...
My system is Win7/64 Enterprise edition and the Python version is 2.7.3 (I need this one...).
This is what I got when I ran idle.py from the command window:
"
C:\Python27\Lib\idlelib>idle.py
Traceback (most recent call last):
File "C:\Python27\Lib\idlelib\idle.py", line 11, in <module>
idlelib.PyShell.main()
File "C:\Python27\Lib\idlelib\PyShell.py", line 1406, in main
root = Tk(className="Idle")
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1685, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, want
objects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
{C:\Program Files (x86)\CSR\BlueSuite 2.5.0} C:/Python27/lib/tcl8.5 C:/lib/t
cl8.5 C:/lib/tcl8.5 C:/library C:/library C:/tcl8.5.2/library C:/tcl8.5.2/librar
y
This probably means that Tcl wasn't installed properly.
"
Indeed there was no "tcl8.5" folder in any of the listed above place but it was under:
"C:\Python27\tcl".
When I copied it under "C:\Python27\lib" then IDLE started (with some other warnings but this seems related to my corp environment...)
In conclusion this looks like either an installer failing to copy the folder where it is supposed to or failing to set up some environment variables correctly or there's an actual bug int the release likely to show up on Win7/64 on certain edition(s).
I am not a Python expert enough to debug Python itself, so please somebody take it from here...in the meantime I will see if the "workaround" is good enough :-)
Just try to delete the files which end with .idlerc in your profile.
1. Enter <win-r>, and type %USERPROFILE%\.idlerc
2. delete all files in idlerc folder
3. it works on my PC(win7 OS)
I ran into this weird situation also, and did a bit of troubleshooting. As a rigorous task, uninstalling, and re-installing the versions of python(2.6, 2.7, 3.1) and all my associated extensions and other site packages: in addition to the subsequent options that others have provided, that may have, or may not have, helped fix issues with the IDLE working properly. I found and error on my part, installing a 32 bit .msi on a 64 bit system causes a runtime .dll error with tkinter and therfore, causes IDLE to not start up properly, or not at all. Be mindful, and don't be a blind bat like me... :)
Once I copied the C:\Python27\tcl\tcl8.5 folder to C:\Python27\Lib as suggested in Bogdan's answer the error message "This probably means that Tcl wasn't installed properly" went away. Instead I started seeing "This probably means that tk wasn't installed properly". I had to copy the C:\Python27\tcl\tk8.5 folder to C:\Python27\Lib as well. Once I did that running idle.py from the command line in C:\Python27\Lib\idlelib was error-free.
Run python setup program, change python 2x, choose to entirely remove tcl/tk, proceed, then run setup again, change python again, on the tcl\tk choose entire feature will be installed, proceed.
It worked for me.
Even I was facing same issue with my code, But It is resolved now.
I was using 2.6 which was having old version of Xlrd, so I updated xlrd in 2.7 using pip and I opened my file with 2.7 and it works.
Delete the .idlerc directory as suggested above, run the python installer again and choose repair. If needed associate the .py files with the python.exe executable in Python27 folder. This worked for me after removing python 3.7.