Problems with importing packages

Hello everyone,

I begin to say that I am not an expert in programming and I am using python4capella at the moment simply to export components and requirements. With that being said, I try to explain my problem. If I follow your tutorial and install directly python3.7 on my Capella directory (I am using Capella 6.0.0), everything works fine, but I am not able to install packages. Indeed, if I try in the preferences menu it does give me ‘FINISHED’ without installing any package. Of course, openpyxl does work as it is yet installed inside the zip folder.

Hence, I put as predefined python engine the one I have yet installed separately for my own other purposes (python 3.11.1). The strange thing is that I am able to import packages. Nevertheless, once I run a code, this happens and everything stops working (see down below the error).

I also tried to install pakages inside the folder of python3.7 (the one in the capella folder) from the ‘external’ python 3.11.1 but once I run the code it returns me error.
In a nusthell, the two approached are complementary in the errors they are producing. This is not a big issue for the things I am doing, as I am using two python in parallel let’s say. Nevertheless, it would be nice if I would be able to import packages and extend the work I am doing (at the moment modify and exporting requirements).

I hope I was clear and apologize since the beginning as maybe I am doing a stupid error. Again, those are my first steps in programming.

Thank you in advance.

Welcome ! And don’t worry we all started at some point.

To install new packages in the provided Python interpreter you can follow this documentation. But I would suggest to use a more recent version of Python.

I guess you are using numpy directly or indirectly (via pandas, …). There is an issue that explain how you can fix this.

Good morning Yvan,

I checked the documentation you linked and now I am able to install packages. Thank you.

The only thing I am not understanding is the error I have in picture above. As soon as I change to the python in the capella folder everything works. This is a minor issue but I would like to understand the problem behind.

Thank you again

The Python API changed from:

thread.setDaemon(True)

to

thread.daemon = True

You can patch the file shown in the error log to remove this error. But as you can see the execution is still running (the red square in the console view). This issue is probably related to numpy (see post above).

Ok I will try to directly patch the file and delete numpy to see if it works. Thank you again.

Everything woks now, thank you a lot.

1 Like