# Import Error while importing Cadet-process module function

**URL:** <https://forum.cadet-web.de/t/import-error-while-importing-cadet-process-module-function/953>\
**Category:** CADET Troubleshooting\
**Created:** [May 14, 2024, 4:10am UTC](https://forum.cadet-web.de/t/import-error-while-importing-cadet-process-module-function/953 "2024-05-14T04:10:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Omparv](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/o/f19dbf/32.png) [@Omparv](https://forum.cadet-web.de/u/Omparv)\
**Post date:** [May 14, 2024, 4:10am UTC](https://forum.cadet-web.de/t/import-error-while-importing-cadet-process-module-function/953/1 "2024-05-14T04:10:33Z")

</div>

Hi Everyone,

I have tried using cadet-process (being a new user to cadet hence more user friendly), but i am unable to import source and sink post installing cadet-process and am facing import error.

Below is the code used:

```python
from CADETProcess.processModel import ComponentSystem
from CADETProcess.processModel import StericMassAction
from CADETProcess.processModel import Source, GeneralRateModel, Sink
from CADETProcess.processModel import FlowSheet
from CADETProcess.processModel import Process

```

Below is the Error reverted with:  
`ImportError: cannot import name 'Source' from 'CADETProcess.processModel' (/usr/local/lib/python3.10/dist-packages/CADETProcess/processModel/ __init__.py)`

PS: I am using google Colab as interface for code and have pip installed latest version of CADET-process

I am not facing error in importing any other function but only for source and sink, so if we can bypass these functions in below code, things should be fine

* * *

```python
import numpy as np

from CADETProcess.processModel import ComponentSystem
from CADETProcess.processModel import StericMassAction
from CADETProcess.processModel import Source, GeneralRateModel, Sink
from CADETProcess.processModel import FlowSheet
from CADETProcess.processModel import Process

# Input Model
c_salt_low = 84.105
c_salt_high = 288.58
c_protein = 0.029

# Component System
component_system = ComponentSystem()
component_system.add_component('Salt')
component_system.add_component('Protein')

# Binding Model
binding_model = StericMassAction(component_system, name='SMA')
binding_model.is_kinetic = True
binding_model.adsorption_rate = [0.0, 4.35E-31]
binding_model.desorption_rate = [0.0, 1.00E-22]
binding_model.characteristic_charge = [0.0, 14.000]
binding_model.steric_factor = [0.0, 261.000]
binding_model.capacity = 710

# Unit Operations
inlet = Source(component_system, name='inlet')
inlet.flow_rate = 2.83e-9

column = GeneralRateModel(component_system, name='column')
column.binding_model = binding_model

column.length = 0.05
column.diameter = 0.15e-2*2
column.bed_porosity = 0.47
column.particle_radius = 3.25E-05
column.particle_porosity = 0.23
column.axial_dispersion = 3.9e-7
column.film_diffusion = [2.0e-5, 1.0e-5]
column.pore_diffusion = [7e-5, 5.5e-12]
column.surface_diffusion = [0.0, 1.38E-15]

column.c = [c_salt_low, 0]
column.q = [binding_model.capacity, 0]

outlet = Sink(component_system, name='outlet')

# flow sheet
flow_sheet = FlowSheet(component_system)

flow_sheet.add_unit(inlet)
flow_sheet.add_unit(column)
flow_sheet.add_unit(outlet, chromatogram_sink=True)

flow_sheet.add_connection(inlet, column)
flow_sheet.add_connection(column, outlet)

# Process
process = Process(flow_sheet, 'lwe')
process.cycle_time = 9898.902

## Create Events and Durations
wash_start = 4232.598
gradient_start = 7407.137
concentration_difference = np.array([c_salt_high, 0.0]) - np.array([c_salt_low, 0.0])
gradient_duration = process.cycle_time - gradient_start
gradient_slope = concentration_difference/gradient_duration

process.add_event('load', 'flow_sheet.inlet.c', [c_salt_low, c_protein])
process.add_event('wash', 'flow_sheet.inlet.c', [c_salt_low, 0.0], wash_start)
process.add_event(
    'grad_start',
    'flow_sheet.inlet.c',
    [[c_salt_low, gradient_slope[0]], [0, gradient_slope[1]]],
    gradient_start
)

process.plot_events()

from CADETProcess.simulator import Cadet
process_simulator = Cadet()

simulation_results = process_simulator.simulate(process)

from CADETProcess.plotting import SecondaryAxis
sec = SecondaryAxis()
sec.component_indices = [0]
sec.y_label = '$c_{salt}$'

simulation_results.solution.column.outlet.plot(secondary_axis=sec)

```

---

<div class="post-metadata">

**Author:** ![ronald.jaepel](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/ronald.jaepel/32/986_2.png) [@ronald.jaepel](https://forum.cadet-web.de/u/ronald.jaepel)\
**Post date:** [May 14, 2024, 7:29am UTC](https://forum.cadet-web.de/t/import-error-while-importing-cadet-process-module-function/953/2 "2024-05-14T07:29:33Z")

</div>

Hey Omparv,

you can use `Inlet` instead of `Source` and `Outlet` instead of `Sink` and things should work.

---

<div class="post-metadata">

**Author:** ![Omparv](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/o/f19dbf/32.png) [@Omparv](https://forum.cadet-web.de/u/Omparv)\
**Post date:** [May 15, 2024, 7:06am UTC](https://forum.cadet-web.de/t/import-error-while-importing-cadet-process-module-function/953/3 "2024-05-15T07:06:17Z")

</div>

Hi Ronald,  
Appreciate your quick response, the solution you provided did work for substitution of source and sink.

Additionally, i have encountered a ‘file not found error’ while plotting simulation results where it requires importing cadet from cadet\_process module in the same code.

The respective code is as follows:

```auto
from CADETProcess.simulator import Cadet
process_simulator = Cadet()

```

The error:  
`FileNotFoundError: Could not autodetect CADET installation. Please provide path.`

For which, i uploaded the cadet files on colab and provided respective path as follows:

```auto
from CADETProcess.simulator import Cadet
process_simulator = Cadet('/content/sample_data/CADET-0.10-py3-none-any.whl')

```

still the process persists even with other .tar.gz file

I am getting a plot as output even with this error

 ![image](https://forum.cadet-web.de/uploads/default/original/2X/1/1bf6dca0e7a80ff96f207d6ba9d9aaf7f459cfba.png)  
which is far from desired plot as follows produced by @l.thiel in one of his replies which was  
 ![image](https://forum.cadet-web.de/uploads/default/original/2X/8/8c382134968d8aadff638e29102232faf60045bd.png)

Below is code provided by him with changes as suggested by you

```auto
import numpy as np

from CADETProcess.processModel import ComponentSystem
from CADETProcess.processModel import StericMassAction
from CADETProcess.processModel import Inlet, GeneralRateModel, Outlet
from CADETProcess.processModel import FlowSheet
from CADETProcess.processModel import Process

# Input Model
c_salt_low = 84.105
c_salt_high = 288.58
c_protein = 0.029

# Component System
component_system = ComponentSystem()
component_system.add_component('Salt')
component_system.add_component('Protein')

# Binding Model
binding_model = StericMassAction(component_system, name='SMA')
binding_model.is_kinetic = True
binding_model.adsorption_rate = [0.0, 4.35E-31]
binding_model.desorption_rate = [0.0, 1.00E-22]
binding_model.characteristic_charge = [0.0, 14.000]
binding_model.steric_factor = [0.0, 261.000]
binding_model.capacity = 710

# Unit Operations
inlet = Inlet(component_system, name='inlet')
inlet.flow_rate = 2.83e-9

column = GeneralRateModel(component_system, name='column')
column.binding_model = binding_model

column.length = 0.05
column.diameter = 0.15e-2*2
column.bed_porosity = 0.47
column.particle_radius = 3.25E-05
column.particle_porosity = 0.23
column.axial_dispersion = 3.9e-7
column.film_diffusion = [2.0e-5, 1.0e-5]
column.pore_diffusion = [7e-5, 5.5e-12]
column.surface_diffusion = [0.0, 1.38E-15]

column.c = [c_salt_low, 0]
column.q = [binding_model.capacity, 0]

outlet = Outlet(component_system, name='outlet')

# flow sheet
flow_sheet = FlowSheet(component_system)

flow_sheet.add_unit(inlet)
flow_sheet.add_unit(column)
flow_sheet.add_unit(outlet)

flow_sheet.add_connection(inlet, column)
flow_sheet.add_connection(column, outlet)

# Process
process = Process(flow_sheet, 'lwe')
process.cycle_time = 9898.902

## Create Events and Durations
wash_start = 4232.598
gradient_start = 7407.137
concentration_difference = np.array([c_salt_high, 0.0]) - np.array([c_salt_low, 0.0])
gradient_duration = process.cycle_time - gradient_start
gradient_slope = concentration_difference/gradient_duration

process.add_event('load', 'flow_sheet.inlet.c', [c_salt_low, c_protein])
process.add_event('wash', 'flow_sheet.inlet.c', [c_salt_low, 0.0], wash_start)
process.add_event(
    'grad_start',
    'flow_sheet.inlet.c',
    [[c_salt_low, gradient_slope[0]], [0, gradient_slope[1]]],
    gradient_start
)

process.plot_events()

from CADETProcess.simulator import Cadet
process_simulator = Cadet('/cl')

simulation_results = process_simulator.simulate(process)

from CADETProcess.plotting import SecondaryAxis
sec = SecondaryAxis()
sec.component_indices = [0]
sec.y_label = '$c_{salt}$'

simulation_results.solution.column.outlet.plot(secondary_axis=sec)

```

---

<div class="post-metadata">

**Author:** ![ronald.jaepel](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/ronald.jaepel/32/986_2.png) [@ronald.jaepel](https://forum.cadet-web.de/u/ronald.jaepel)\
**Post date:** [May 15, 2024, 8:56am UTC](https://forum.cadet-web.de/t/import-error-while-importing-cadet-process-module-function/953/4 "2024-05-15T08:56:12Z")

</div>

That’s a surprising error which should not happen. Did you install `CADET` with `conda` or compile `CADET` yourself?  
To clarify: `CADET-Process` is the front-end / user interface for the `CADET` core simulator. `CADET-Process` can be installed with `pip` but the `CADET` core simulator needs to be installed with`conda` or compiled yourself?  
Then, if you have a `CADET` installation with `conda` in the same python environment that you are using for your scripts, `CADET-Process` will auto detect `CADET`. If it doesn’t you can link against `cadet-cli.exe` on windows or `cadet-cli` on Linux. It can be found at e.g.  
`C:\Users\username\anaconda\envs\environment_name\bin\cadet-cli.exe`

---

<div class="post-metadata">

**Author:** ![101abhinav](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/1/a587f6/32.png) [@101abhinav](https://forum.cadet-web.de/u/101abhinav)\
**Post date:** [May 29, 2025, 9:52am UTC](https://forum.cadet-web.de/t/import-error-while-importing-cadet-process-module-function/953/5 "2025-05-29T09:52:40Z")

</div>

I am facing the same issue of “Could not autodetect CADET installation. Please provide path.” I installed the CADET core and CADET-Process from the sources you mentioned but it still gives the same issue. I did found the path at which cadet-cli.exe exists. But since I’m a newbie I don’t know how to link against `cadet-cli.exe` on windows in a python script. Please guide.

The code I’m trying to run is as follows:

```Python
from CADETProcess.simulator import Cadet

# Initialize the simulator
simulator = Cadet()

# Check if CADET-Core is accessible
if simulator.check_cadet():
    print("CADET-Core is accessible.")
else:
    print("CADET-Core is not accessible.")

```

The whole Traceback is as follows:

```auto
runfile('C:/Users/modia/OneDrive - IIT Delhi/Desktop/cadet_test.py', wdir='C:/Users/modia/OneDrive - IIT Delhi/Desktop')
Traceback (most recent call last):

  File ~\anaconda3\envs\cadet-env\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
    exec(code, globals, locals)

  File c:\users\modia\onedrive - iit delhi\desktop\cadet_test.py:4
    simulator = Cadet()

  File ~\anaconda3\envs\cadet-env\lib\site-packages\CADETProcess\simulator\cadetAdapter.py:98 in __init__
    self.install_path = CadetAPI.autodetect_cadet()

  File ~\anaconda3\envs\cadet-env\lib\site-packages\cadet\cadet.py:369 in autodetect_cadet
    raise FileNotFoundError(

FileNotFoundError: Could not autodetect CADET installation. Please provide path.

```

---

<div class="post-metadata">

**Author:** ![ronald.jaepel](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/ronald.jaepel/32/986_2.png) [@ronald.jaepel](https://forum.cadet-web.de/u/ronald.jaepel)\
**Post date:** [May 29, 2025, 11:53am UTC](https://forum.cadet-web.de/t/import-error-while-importing-cadet-process-module-function/953/6 "2025-05-29T11:53:54Z")

</div>

Hello 101abhinav,

welcome to the CADET Forum!

To use a specific cadet-cli path, you can hand the path over to the `Cadet` class during instantiation:  
`simulator = Cadet(install_path='/path/to/cadet/cadet-cli.exe')`

If that does not work, you can send us the output of `conda list` and `pip list` and we can look further into it.

---

<div class="post-metadata">

**Author:** ![101abhinav](https://forum.cadet-web.de/letter_avatar_proxy/v4/letter/1/a587f6/32.png) [@101abhinav](https://forum.cadet-web.de/u/101abhinav)\
**Post date:** [May 29, 2025, 12:08pm UTC](https://forum.cadet-web.de/t/import-error-while-importing-cadet-process-module-function/953/7 "2025-05-29T12:08:54Z")

</div>

> [@ronald.jaepel](#):
>
> install\_path=‘/path/to/cadet/cadet-cli.exe’

Hello Ronald, thanks for quick reply the code did work with an error message beside it.  
C:\Users\modia\anaconda3\envs\cadet-env\lib\site-packages\cadet\cadet.py:59: UserWarning: The specified install\_path is not the root of the CADET installation. It has been inferred from the file path.  
warnings.warn(  
C:\Users\modia\anaconda3\envs\cadet-env\lib\site-packages\cadet\cadet.py:569: FutureWarning: Cadet.run() will be removed in a future release.  
Please use Cadet.run\_simulation()  
warnings.warn(  
Test simulation completed successfully  
CADET-Core is accessible.

The system cannot find the path specified.

Do you still need conda list and pip list??

---

<div class="post-metadata">

**Author:** ![ronald.jaepel](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/ronald.jaepel/32/986_2.png) [@ronald.jaepel](https://forum.cadet-web.de/u/ronald.jaepel)\
**Post date:** [May 31, 2025, 2:10pm UTC](https://forum.cadet-web.de/t/import-error-while-importing-cadet-process-module-function/953/9 "2025-05-31T14:10:00Z")

</div>

Glad to hear it. The last `The system cannot find the path specified.` seems to be a new error. Please open a new Topic to address this issue and supply the full code there. Thank you.

---

<div class="post-metadata">

**Author:** ![h.lanzrath](https://forum.cadet-web.de/user_avatar/forum.cadet-web.de/h.lanzrath/32/1186_2.png) [@h.lanzrath](https://forum.cadet-web.de/u/h.lanzrath)\
**Post date:** [January 27, 2026, 11:45am UTC](https://forum.cadet-web.de/t/import-error-while-importing-cadet-process-module-function/953/10 "2026-01-27T11:45:30Z")

</div>


