Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using python 3.9.6 #13

Closed
GuanqiDong92 opened this issue Jul 24, 2024 · 15 comments
Closed

Error when using python 3.9.6 #13

GuanqiDong92 opened this issue Jul 24, 2024 · 15 comments

Comments

@GuanqiDong92
Copy link

image I want to install cfspopcon on Mac, but it seems to have failed to start well with the example. Do you have a similar problem?
@hassec
Copy link
Collaborator

hassec commented Jul 24, 2024

@GuanqiDong92 Could you post some more details about how one can reproduce this issue?
E.g. how was your python environment setup, and what steps did you take to install cfspopcon

@tbody-cfs
Copy link
Collaborator

@GuanqiDong92 it looks like you haven't run radas yet. https://cfspopcon.readthedocs.io/en/latest/doc_sources/Usage.html

@GuanqiDong92
Copy link
Author

@GuanqiDong92 Could you post some more details about how one can reproduce this issue? E.g. how was your python environment setup, and what steps did you take to install cfspopcon

hi @hassec , the python version and the environment are as follows
image

As for the installation of cfspopcon, I just use "pip install cfspopcon" following the instruction in https://cfspopcon.readthedocs.io/en/latest/doc_sources/Usage.html as @tbody-cfs commented.

@hassec
Copy link
Collaborator

hassec commented Jul 25, 2024

@GuanqiDong92

Can you try running the radas command again with the --verbose flag:

radas --verbose -d ./radas_dir

If that crashes again and drops you into the debugger (ipdb), could you type bt, hit enter and post the resulting backtrace here?

@GuanqiDong92
Copy link
Author

@GuanqiDong92

Can you try running the radas command again with the --verbose flag:

radas --verbose -d ./radas_dir

If that crashes again and drops you into the debugger (ipdb), could you type bt, hit enter and post the resulting backtrace here?

@hassec , here is the result
image

@tbody-cfs
Copy link
Collaborator

Hi @GuanqiDong92. Could you try rm -rf ./radas_dir and then rerun the radas --verbose -d ./radas_dir command? This should take about 10-15 mins — it's important to not kill the process while this runs.

It looks like you're missing some of the files needed for the ADAS reader.

@GuanqiDong92
Copy link
Author

Hi @tbody-cfs , it does not work for me.....
image

@hassec
Copy link
Collaborator

hassec commented Jul 25, 2024

Thanks @GuanqiDong92. I can reproduce the problem when using python 3.9.6 like you.
The reason for the error is that radas is using:

shutil.unpack_archive(output_filename, output_folder, filter="data")

But passing filter='data' is a security patch that only is available to python 3.9.17 and later.

So the easiest workaround would probably be to use a newer python version. We'll fix this on radas, but likely just by requiring a newer python version as passing filter='data' has security benefits.

@hassec hassec transferred this issue from cfs-energy/cfspopcon Jul 25, 2024
@hassec hassec changed the title Could not have a good start Error when using python 3.9.6 Jul 25, 2024
@tbody-cfs
Copy link
Collaborator

@GuanqiDong92 I've opened #14 as a potential fix. You're welcome to try run that version of radas before we get it onto PyPi, following the instructions below

cd .. #change to some folder where you want to install radas
git clone [email protected]:cfs-energy/radas.git
cd radas
git checkout patch_shutil_for_py39
poetry install
poetry run radas --verbose
cd ../cfspopcon #change back to the cfspopcon repository
cp -r ../radas/radas_dir .
poetry run popcon example_cases/SPARC_PRD --show

@hassec
Copy link
Collaborator

hassec commented Jul 25, 2024

A new version of cfspopcon has been released: https://pypi.org/project/cfspopcon/6.0.1/ which requires the fixed version of radas.
Closing this issue, but if you run in any more problems, please feel free to reopen the issue.

@hassec hassec closed this as completed Jul 25, 2024
@GuanqiDong92
Copy link
Author

git clone [email protected]:cfs-energy/radas.git

hi @tbody-cfs , when I try "poetry run radas", it comes to the following error..
image

I googled it, it seems clang/gcc have conflicts. But I don't know how to fix it, could you please help?

@tbody-cfs
Copy link
Collaborator

How did you install gfortran? I'd suggest using brew install gcc (https://fortran-lang.org/learn/os_setup/install_gfortran/#homebrew)

If you've already done that, can you paste here your which gfortran?

@GuanqiDong92
Copy link
Author

How did you install gfortran? I'd suggest using brew install gcc (https://fortran-lang.org/learn/os_setup/install_gfortran/#homebrew)

If you've already done that, can you paste here your which gfortran?

please forget my last information. After I reinstalled gcc and Python, I redone all the previous steps. However,
image

but I try install importlib-metadata, it did not work...

@tbody-cfs
Copy link
Collaborator

Have you run poetry install in the cfspopcon folder?

If there are issues in cfspopcon, please re-open an issue in that repository. Also, for the future, please copy-paste the error message instead of screenshots, since this makes it easier for others to search and find related issues.

@GuanqiDong92
Copy link
Author

Have you run poetry install in the cfspopcon folder?

If there are issues in cfspopcon, please re-open an issue in that repository. Also, for the future, please copy-paste the error message instead of screenshots, since this makes it easier for others to search and find related issues.

@tbody-cfs thank you. it works now after I run poetry install in the cfspopcon folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants