fusion-energy / fusion_neutronics_workflow

Combines open source packages to produce an automated fusion specific neutronics workflow
MIT License
12 stars 3 forks source link

can't import cadquery #42

Open RemDelaporteMathurin opened 2 years ago

RemDelaporteMathurin commented 2 years ago

How to reproduce the issue:

1) Run:

docker run -it ghcr.io/fusion-energy/fusion-neutronics-workflow

using the latest tag

2) Navigate to the examples folder:

cd examples/example_01_single_volume_cell_tally/

3) Run

python 1_create_cad_and_convert_to_dagmc.py

This produces:

Traceback (most recent call last):
  File "1_create_cad_and_convert_to_dagmc.py", line 4, in <module>
    import paramak
  File "/opt/conda/lib/python3.8/site-packages/paramak/__init__.py", line 14, in <module>
    from .shape import Shape
  File "/opt/conda/lib/python3.8/site-packages/paramak/shape.py", line 10, in <module>
    import cadquery as cq
  File "/opt/conda/lib/python3.8/site-packages/cadquery/__init__.py", line 14, in <module>
    from .occ_impl import exporters
  File "/opt/conda/lib/python3.8/site-packages/cadquery/occ_impl/exporters/__init__.py", line 10, in <module>
    from ...cq import Workplane
  File "/opt/conda/lib/python3.8/site-packages/cadquery/cq.py", line 54, in <module>
    from .selectors import (
  File "/opt/conda/lib/python3.8/site-packages/cadquery/selectors.py", line 23, in <module>
    from pyparsing import (
ImportError: cannot import name 'upcaseTokens' from 'pyparsing' (/opt/conda/lib/python3.8/site-packages/pyparsing/__init__.py)
RemDelaporteMathurin commented 2 years ago

Subsenquently, I can't import paramak either

shimwell commented 2 years ago

Hi Remi, sorry for this bug. Thanks for reporting. I spotted the same bug on my last PR from develop to main and starting fixing this bug. I shall get back to it today.

shimwell commented 2 years ago

This bug is due to the dockerfile installing paramak version 0.7 instead of the newer versions such as 0.8.1

RemDelaporteMathurin commented 2 years ago

I don't think so cause I can also reproduce the error without importing paramak:

1) docker run -it --rm ghcr.io/fusion-energy/fusion-neutronics-workflow 2) run python 3) run import cadquery

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/lib/python3.8/site-packages/cadquery/__init__.py", line 14, in <module>
    from .occ_impl import exporters
  File "/opt/conda/lib/python3.8/site-packages/cadquery/occ_impl/exporters/__init__.py", line 10, in <module>
    from ...cq import Workplane
  File "/opt/conda/lib/python3.8/site-packages/cadquery/cq.py", line 54, in <module>
    from .selectors import (
  File "/opt/conda/lib/python3.8/site-packages/cadquery/selectors.py", line 23, in <module>
    from pyparsing import (
ImportError: cannot import name 'upcaseTokens' from 'pyparsing' (/opt/conda/lib/python3.8/site-packages/pyparsing/__init__.py)
RemDelaporteMathurin commented 2 years ago

This bug is due to the dockerfile installing paramak version 0.7 instead of the newer versions such as 0.8.1

Updating to paramak 0.8.1 didn't fix it apparently

https://github.com/fusion-energy/fusion_neutronics_workflow/runs/6653637317?check_suite_focus=true

RemDelaporteMathurin commented 2 years ago

Installing cadquery-master in a conda environment did not produce the issue:

conda create --name cadquery_temp
conda activate cadquery_temp
conda install -c cadquery -c conda-forge cadquery=master
python
import cadquery
shimwell commented 2 years ago

I think the latest release has fixed this error, both CI test routines are working again. Please reopen if this problem persists