- Notifications
You must be signed in to change notification settings - Fork768
[Solved] How can i solve this error "ModuleNotFoundError: No module named 'encodings'" under ubuntu20.04?#2147
-
I want to use Python in a .NET project, and under Windows, I can use Python with the python3.10.dll. Unfortunately, this project needs to run in a Docker container. First, I tried to set up all components in Ubuntu 20.04, but when I linked the python3.10.so to Runtime.PythonDLL, I got the following error: Python path configuration: Current thread 0x00007f1641311740 (most recent call first): My guess is that I'm not setting some necessary library, but I don't know which one it is. |
BetaWas this translation helpful?Give feedback.
All reactions
I could fix it. Unfortunately, under Ubuntu, we cannot use the PYTHONHOME and PYTHONPATH variables. If you use these variables, you will get the "ModuleNotFoundError: No module named 'encodings'" error. If you use your own packages, such as creating a class structure and importing it into your project file, you must copy it to the "dist-packages" folder.
Replies: 1 comment 2 replies
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I could fix it. Unfortunately, under Ubuntu, we cannot use the PYTHONHOME and PYTHONPATH variables. If you use these variables, you will get the "ModuleNotFoundError: No module named 'encodings'" error. If you use your own packages, such as creating a class structure and importing it into your project file, you must copy it to the "dist-packages" folder. |
BetaWas this translation helpful?Give feedback.
All reactions
-
That is not true. You probably just set them incorrectly, I see that your path refers to |
BetaWas this translation helpful?Give feedback.
All reactions
-
The path is indeed set incorrectly. On Linux, you need to use |
BetaWas this translation helpful?Give feedback.