You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get this error message in Visual Studio code. I'm using Windows 11.
File "c:\Pythoncode\Ramanspy\virt\ii_rruff.py", line 21, in
ramanspy.datasets.rruff("c:\Pythoncode\Ramanspy", download=True)
File "c:\Pythoncode\Ramanspy\virt\Lib\site-packages\ramanspy\datasets.py", line 464, in rruff
return _download_rruff(dataset)
^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Pythoncode\Ramanspy\virt\Lib\site-packages\ramanspy\datasets.py", line 478, in download_rruff
with ZipFile(BytesIO(zipresp.read())) as zipfile:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RobertS\AppData\Local\Programs\Python\Python312\Lib\zipfile_init.py", line 1339, in init
self.RealGetContents()
File "C:\Users\RobertS\AppData\Local\Programs\Python\Python312\Lib\zipfile_init.py", line 1406, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file error when script is run
cody says the error error is occurring in the ramanspy library's dataset downloading functionality, so ensuring you have the latest version of the library might also help, but I just installed the program less than a week ago and I'm sure that's not the problem. I'm using 0.2.10. When I download and extract the zip file with Windows and run a ramanspy script to print out the metadata such as this:
dataset_name = 'fair_oriented' # Replace with the desired dataset name
spectra, metadata = rp.datasets.rruff(dataset_name, download=False) # Display some information about the loaded spectra
print(f"Loaded spectra for dataset: {dataset_name}")
print(f"Number of spectra: {len(spectra)}")
print(f"Metadata: {metadata}")
It prints out everything as it should, so I'm wondering if the problem is the zip files are in the wrong format at the RRUFF database?
The text was updated successfully, but these errors were encountered:
I have a problem when trying to download a dataset from the rruff database. Using this slightly modified code from the Ramanspy doc site.
"""
Loading the RRUFF dataset
In this tutorial, we will see how to load the :ref:
RRUFF data
usingRamanSPy
."""
import sys
sys.path.append("c:\Pythoncode\Ramanspy\virt\Lib\site-packages")
import ramanspy
dataset_name = 'poor_oriented'
ramanspy.datasets.rruff("c:\Pythoncode\Ramanspy", download=True)
File "c:\Pythoncode\Ramanspy\virt\ii_rruff.py", line 21, in
ramanspy.datasets.rruff("c:\Pythoncode\Ramanspy", download=True)
File "c:\Pythoncode\Ramanspy\virt\Lib\site-packages\ramanspy\datasets.py", line 464, in rruff
return _download_rruff(dataset)
^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Pythoncode\Ramanspy\virt\Lib\site-packages\ramanspy\datasets.py", line 478, in download_rruff
with ZipFile(BytesIO(zipresp.read())) as zipfile:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RobertS\AppData\Local\Programs\Python\Python312\Lib\zipfile_init.py", line 1339, in init
self.RealGetContents()
File "C:\Users\RobertS\AppData\Local\Programs\Python\Python312\Lib\zipfile_init.py", line 1406, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file error when script is run
cody says the error error is occurring in the ramanspy library's dataset downloading functionality, so ensuring you have the latest version of the library might also help, but I just installed the program less than a week ago and I'm sure that's not the problem. I'm using 0.2.10. When I download and extract the zip file with Windows and run a ramanspy script to print out the metadata such as this:
dataset_name = 'fair_oriented' # Replace with the desired dataset name
spectra, metadata = rp.datasets.rruff(dataset_name, download=False) # Display some information about the loaded spectra
print(f"Loaded spectra for dataset: {dataset_name}")
print(f"Number of spectra: {len(spectra)}")
print(f"Metadata: {metadata}")
It prints out everything as it should, so I'm wondering if the problem is the zip files are in the wrong format at the RRUFF database?
The text was updated successfully, but these errors were encountered: