Matplotlib and FileNotFoundError - python

I'm using anaconda3 and facing such problem:
FileNotFoundError: [Errno 2] No such file or directory 'C:\Users\pobox\.matplotlib\fontlist-v300.json'
And the fact is in the folder .matplotlib I didn't find such file fontlist-v300.json.
I know the problem may be connected with the matplotlib, but the problem is occuring even after updating the version of matplotlib.
Any ideas how to fix it?
my screenshot

Based from the update of the issue https://github.com/matplotlib/matplotlib/issues/12173/, you could try update matplotlib to the latest version. But people still reporting the problems persists, so the bug might still in works.
You could try this option, and match it with your current Python environments
For the file itself, you may try to check this: https://gitlab.lagash.com/josemg/sofy-luis-quality/blob/b1ddf1ec3577bdec0d798c8586c30b6d6fc10f5f/.cache/matplotlib/fontlist-v300.json

Related

Opening fits files with no SIMPLE keyword in python

I have a large number of fits files that I'm unable to open becuase of a missing SIMPLE keyword. When I try to open them using astropy's fits.open() it gives the following error:
OSError: No SIMPLE card found, this file does not appear to be a valid FITS file
I tried adding the ignore_missing_simple=True option to fits.open(), but this still gives an error:
OSError: Empty or corrupt FITS file
I'm not sure what to do here. My first thought was to edit the fits header to add a SIMPLE keyword, but if I can't open the file I don't know how to deal with this. I'm wondering if theres more going on than just the missing SIMPLE keyword given the second error.
If it matters, I've downloaded the fits files, I did not generate them myself.
We traced the problem to astropy.io.fits version 4.3
Files generated with version 4.2 can be read with 4.0 or 4.2 but this error pops up with 4.3.1. You could try again after downgrading astropy.io.fits.
Which version of astropy are you using? The problem occurs on 4.3, but it works just fine in 4.2.
This GitHub issue reports the problem in the astropy repository.
I propose you downgrade until the issue is fixed.

ERROR: Could not install packages due to an EnvironmentError: [Errno 9] Bad file descriptor

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

python-docx won't install ERROR conda.core.link:_execute(700)

Not sure what is going on here, but I get the following error when trying to install python-docx on my server:
ERROR conda.core.link:_execute(700): An error occurred while installing package 'conda-forge::lxml-4.5.0-py38hbb43d70_1'.
[Errno 13] Pewrmission denied: '.../anaconda3/envs/django_env/lib/python3.8/site-packages/lxml/ElementInclude.py
The thing is, there is no such file that I can find in that location, so not sure what this is all about, any help would be appreciated, I've not found anything at all on google relating to this.
This is now solved, but my solution was to uninstall Anaconda and reinstall it. This error occurred because the original error advised me to rename or manually delete the ElementInclude.py file. So I did that knowing it was only the Anaconda distribution not a linux system file, but it broke the my website anyway. The fault initially cropped up, as we were trying to use Anaconda on another account whilst it was installed on my account. Anaconda3 is now installed in root so that it is accessible by all users now. I still had to set it to PATH on each of the two accounts that wanted access, but doing that python-docx installed with no issues.

Installing font from TTF file

I have tried to install a font I have in a ttf file in various ways using the many answers relating to this that I found on SO. Note: I have got the ttf file in the same folder as the code that I am running. I am trying to install this font so that I can use a mono-space font in kivy, so that tables format correctly. Here is what I tried:
I copied the function from this answer and added: install_font(r'C:\Users\User\Documents\python\SourceCodePro-Black.ttf') on to the end of the code and ran it. I got an error. PermissionError: [Errno 13] Permission denied: 'C:\\WINDOWS\\Fonts\\SourceCodePro-Black.ttf'
Tried to install it by using this method. It successfully installed fonttools, but it did not manage to import it somehow. I tried importing both fonttools and fontTools.
I also had a look at this answer but the comment underneath it suggested I shouldn't try that.
There doesn't seem to be a highly upvoted thread which details how to do this. What is the best method for doing this? Is it one of the above? And if so, what am I doing wrong?

WindowsError: [Error 127] The specified procedure could not be found

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.

Categories

Resources