How do I solve "pythoncom39.dll could not be located error"? - python

It has started appearing ever since I installed Anaconda on my PC. It doesn't affect anything and when I press "Ok" it goes away. But it is quite annoying and I would like to know the reason. It has only appeared when I try to run a development server in Django or try to install python modules using pip. Is there any way to solve this?

It happens because anacondaa3\Library\bin\ in this folder pythondicom39.dll has crashed you need to replace it with a new file

Yes, that dll file might be corrupted. Just replace, and then try it. You can download the pythoncom39.dll files from the following link
https://freeonlinestudies.com/python-dlls/

Related

RuntimeError: Unable to open shape_predictor_68_face_landmarks.dat?

I´ve made a project with python OpenCV, and used the shape_predictor_68... a .dat file.
Now when I build the project with cx_freeze, everything does right, but when I run the app build, it shows a error.
I am also facing the same issue but after some search, I get to know my shape_predictor_68_face_landmarks.dat is not updated or correct so I replace it with another and issue resolved, the link for the new shape_predictor_68_face_landmarks.dat file is
https://github.com/AKSHAYUBHAT/TensorFace/blob/master/openface/models/dlib/shape_predictor_68_face_landmarks.dat
replace the new file with older one.
Referring the solution to a similar issue here
If you are getting this error:
RuntimeError: Unable to open /home/lyz/openface-master/demos/web/../../models/dlib/shape_predictor_68_face_landmarks.dat
You probably haven't downloaded dlibs models properly, perform Step 4 from https://cmusatyalab.github.io/openface/setup/ again. In short, cd into your openface library and run
./models/get-models.sh
Also, I can't tell how you are running this but it could also be a case that the library may not be correctly imported in your current venv - where your interpreter is.
Install dlib correctly and just paste this .dat file in the same working directory as your code is present and try to run the code.
The link is
http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
You can find the .dat file here after extracting a WinZip file that can be downloaded from the dlib.net website.

File permissions issue with python/Spyder/Anaconda after upgrading mac to Catalina

After upgrading macOS to Catalina, my Anaconda installation was helpfully reconfigured by Apple. Advice from the Anaconda website suggested a fresh install was the best way to go. Did that and all seemed good. I use spyder from the Anaconda navigator. But trying a previously running python code failed due to apparent file permission problems. For example,
file='/Users/stingay/Documents/Coaching/WAIS/2019:20/041019/Race Walk Test-2019-10-04T16.29.13.774-C5612E80FB1D-Accelerometer.csv'
with open(file,'rt') as f:
data = csv.reader(f)
next(data)
results in:
PermissionError: [Errno 1] Operation not permitted: '/Users/stingay/Documents/Coaching/WAIS/2019:20/041019/Race Walk Test-2019-10-04T16.29.13.774-C5612E80FB1D-Accelerometer.csv'
I can't see an issue with the permissions on the file or the directory structure in which the file sits. If I move the file to~/.spyder-py3 (the working directory), it works.
Looks like there is some extra python/spyder/anaconda permissions issue with the file/directory I can't spot. Any ideas?
I guess you have solved this by now, but for future reference, I still post my answer.
TLDR: I opened a file (from the folder causing the problem) directly in
the spyder editor (File | open). As a consequence, the editor should have triggered the pop-up dialog question whether you want to allow access or not. In my case, the mac silently granted python/spyder access to the folder. Now I can run the code in spyder without more problems than I have caused myself.
Longer version:
The source of your problem is described here:
https://www.howtogeek.com/443611/how-macos-catalinas-new-security-features-work/
Knowing that links are something frown upon, here's a summary:
The problem is that the folders "Documents" and "Downloads" folders nowadays are protected and you would need to go to the security & privacy settings and "Files and Folder,s" and allow the applications to access these. Unfortunately, spyder does not show up here. So, if you want to run your python program from the terminal, you should probably grant the terminal access to the folders.
Total noob here, but I might have stumbled upon a solution for people that have problems reading in their data in spyder after the Catalina update. I had the same problems you describe and got the same file permission errors.
I couldn't resolve the issue, reinstalled several times but didn't work for me. I couldn't use my Utorrent either, and while attempting to solve that problem I came across https://discuss.pixls.us/t/problems-with-darktable-and-mac-osx-catalina-solved-with-dt-2-6-3-1/14400/19 this forum.
Long story short, in the forum people couldn't really resolve the issue, but someone pointed out that if you just run the application from the terminal, it somehow works. I tried to do this with Spyder, and I seem to be able to use the read_csv('file') function again. So try opening the terminal, then type 'spyder' (without '') and press enter. Somehow all issues seem to be resolved. Hope this helps someone.
Same problem here. I re-installed Anaconda based on this link and Python is able to access folders where Catalina has added newly restricted security:
Install Anaconda following instructions below:
https://www.anaconda.com/how-to-restore-anaconda-after-macos-catalina-update/
For Anaconda-Jupyter user, you are good to go
For Commandline (Terminal) Python user, you are good to go
For Anaconda-Spyder user, two options as a workaround after installation above:
Avoid Mac default setup-folders and relocate files to /Users/[user_name]/..
OR
Launch Spyder through Terminal (execute "sudo spyder") under root user
Lastly, changing or reseting folder/file permission does not resolve permission issue. Despite of the security issue under the more restricted security folders, somehow Spyder-Python is able to open .py files in these folders.
Since Jupyter and commandline Python can access these folders, I assume there will be a fix in the future for Anaconda-Spyder.
My code didn't work at all after Catalina update. The simplest partial solution that I found was to copy all files containing the scripts in a new folder. That works at least to run the codes, but I still dealing with annoying message to allow access to my files.
conda update --all in terminal worked for me. It updated everything. I did have to go through the annoying messages for access to my files as well. but after clicking yes a hundred times it was ab

Spyder: [Errno 2] No such file or directory

I want to run this code in Github : https://github.com/llazzaro/lsa_python
but I don't know how to execute it with nosetests. I have python 2.7.11 and anaconda 4.0.0, I have to run it with Spyder because I need scientific packages so when I put this link: https://github.com/llazzaro/lsa_python on Spyder I get this:
[C:\Anaconda2\python.exe: can't open file 'C:\Users\CLIENT\Desktop\lsa_python-master\sanstitre0.py': [Errno 2] No such file or directory]
Maybe you need to set your working directory correctly. It probably looks for the path from the current working directory.
You can change it here:
Little late to answer these questions But still if anyone facing the same issue this answer might help
I was facing the same issue. I even reinstall the anaconda. But it's still doing the same issue. Then I figure out something very silly.
First of all, you have to set your working directory
After that, you have to hit the Run button.
I was pressing ctrl + enter
But after setting the working directory for the first time you have to hit the run button then it will work
Hope it will help.

IDLE 3.5 won't open

I'm really confused. For some reason, I suddenly can't open IDLE 3.5. I have tried uninstalling it and reinstlling, but no luck. I was told to delete the folder .idlerc but it hasn't come back after constant tries. Was that a huge mistake? I have no idea what's going on.
Is it just the IDE? Or the python install itself?
When having problems using IDLE as an IDE I would recommend using PyCharm. It offers imho the best options for Python developing.
A common cause of failure of idle startup is a user-written file with the same name as a standard library module, such as random.py and tkinter.py.
First make sure you dont have a file named random.py and tkinter.py in the current folder.
All the startup failures of idle are described here.
I had the same problem. Turned out I had a python program named 'random.py'. Idle would not run until I renamed that program!

Python IDLE won´t start

I´m a noob in python and about a week ago IDLE stop working, I have readed some other people questions about this, but none of them had the same error that I´m getting, which is:
Traceback (most recent call last):
File "c:\python26\Lib\idlelib\idle.py", line 21, in <module>
idlelib.Pyshell.main()
File "C:\python26\Lib\idlelib\PyShll.py", line 1386, in main
root = Tk(className="Idle")
File "C:\python26\Lib\lib-tk\Tkinter.py", line 1643, in __init__
self.tk = _tkinter.creat(screenName, baseName, className, interactive, want
objects, useTk, sync, use)
_tkinter.TclError: Can´t find a usable init.tcl in the following directories:
C:/Python26/lib/tcl8.5 c:/lib/tcl8.5 c:/lib/tcl8.5 c:/library c:/library c:/
tcl8.5.2/library c:/tcl8.5.2/library
This probably means that Tcl wasn´t installed properly.
So I have reinstall python about 3 to 4 times and I keep getting the same error.
I´ll will for ever be in debt to anyone that gives me a solution to this error.
By the way, I´m running Python 2.6.6 on Win 7 32-Bit.
Thank you.
This TCL issue has appeared in a number of Python forums and is generally prevents the IDLE GUI from starting e.g. http://www.gossamer-threads.com/lists/python/python/902912 and is related to the TCL_LIBRARY enviroment variables. Try and edit the enviroment variables
Right click on (My) Computer, go to properties, Advanced Tab, press Environment Variables and edit TCL_LIBRARY to indicate the Python path e.g C:\Python26\tcl\tcl8.5 (or enter the path that represents your version. Idle should start then.
I noticed that this is an issue when you install other programs that may depend on the TCL Library. Happened to me after I installed SciLab. Therefore changing the variable may cause issues with another installed app.
Hope this helps.
Some folders may have been deleted or removed.
Go to Uninstall Program
Choose Python
Click "Change"
Then click "repair"
Allow the computer to repair....Should work after this.
Some notes*
Always make sure everything is in the same directory that you are working in CMD. I opened up my directory from the cmd and put my files in the same directory.
Check your 'App data' folder too for any Python files.
Be aware that 'App data' folder may be hidden.
Also when you reinstall click customize and python will allow you to make your own customize path location which is helpful and a lot more simple then what python chooses.
This could be caused by using the wrong version of Python.
32-bit and 64-bit work differently.
(Assuming your Python install is not corrupt. Did you make any changes to the Python install, try and install anything else?)
What is your Python install directory?
Look under Python_install_directory/tcl , init.tcl should be there, is it?
Tell us what you find.
Hey I don't know why this worked for me but I just right clicked on the the idle icon and clicked "Duplicate". This created another icon "IDLE duplicate", weirdly, and when I try to open this version it works. Hope this helps!

Categories