<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF Connect SDK: ModuleNotFoundError: No module named &amp;#39;encodings&amp;#39;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99562/nrf-connect-sdk-modulenotfounderror-no-module-named-encodings</link><description>Hi, 
 I am using the nRF Connect SDK 2.3.0 and running into an issue when calling python from the terminal opened from the Toolchain Manager (via the Open Terminal option). 
 Calling `python` from this terminal gives me the following error: 
 
 If I use</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Sep 2023 11:55:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99562/nrf-connect-sdk-modulenotfounderror-no-module-named-encodings" /><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/444308?ContentTypeID=1</link><pubDate>Mon, 04 Sep 2023 11:55:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da41a6a7-6fd1-402d-941c-47ca579e4c5c</guid><dc:creator>mlac</dc:creator><description>&lt;p&gt;I understand, and thanks for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/444306?ContentTypeID=1</link><pubDate>Mon, 04 Sep 2023 11:50:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3315bcb-fa1c-446a-ad47-b8ee863d2b00</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;At this point, I think I can not say anything more that:&lt;/p&gt;
&lt;p&gt;Linux Mint is not something we have official support for in the Toolchain Manager, so we can not guarantee that it works.&lt;br /&gt;I suggest the manual installation as an alternative&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/444292?ContentTypeID=1</link><pubDate>Mon, 04 Sep 2023 10:52:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7a2da7e-602c-49b8-9755-6ee719e7183e</guid><dc:creator>mlac</dc:creator><description>&lt;p&gt;When I try the solution contained in the referenced thread, I get the following error:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-from-2023_2D00_09_2D00_04-12_2D00_49_2D00_17.png" /&gt;&lt;/p&gt;
&lt;p&gt;The relevant setting that I set:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/2402.b.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/444259?ContentTypeID=1</link><pubDate>Mon, 04 Sep 2023 09:06:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8522aa62-9226-42b1-bf75-29d43be06e3f</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;This case looks very similar: &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/88579/nrf-connect-toolchain-fails"&gt;nRF Connect Toolchain fails&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Does the answers in this case help?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/444199?ContentTypeID=1</link><pubDate>Sun, 03 Sep 2023 22:00:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a75f1d1-6cf4-44bc-964d-ff92d5cb0c11</guid><dc:creator>mlac</dc:creator><description>&lt;p&gt;Yes, I get the encoding error by simply invoking &amp;quot;python&amp;quot; from the nRF terminal but not by invoking python3.&lt;/p&gt;
&lt;p&gt;I also get the error when trying to build the project using VS Code or west. (I open VS Code and the terminal from the toolchain manager.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/443430?ContentTypeID=1</link><pubDate>Mon, 28 Aug 2023 15:41:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17f89943-1693-41a3-9def-e7833efba110</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="mlac"]&lt;p&gt;I&amp;#39;ve already provided what you&amp;#39;re asking in my first comment above.&lt;/p&gt;
&lt;p&gt;PYTHONPATH is&amp;nbsp;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local/lib/python3.8/site-packages&lt;/p&gt;[/quote]
&lt;p&gt;Ah, I missed that.&lt;/p&gt;
&lt;p&gt;From your logs, do I understand it correctly that you get the error when you just type &amp;quot;python&amp;quot; inside that terminal?&lt;br /&gt;Do you also get the same error when trying to build a project using VS Code or west?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/443169?ContentTypeID=1</link><pubDate>Fri, 25 Aug 2023 12:29:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d316f12-b90f-4cdd-bacf-585bdca0808e</guid><dc:creator>mlac</dc:creator><description>&lt;p&gt;I&amp;#39;ve already provided what you&amp;#39;re asking in my first comment above.&lt;/p&gt;
&lt;p&gt;PYTHONPATH is&amp;nbsp;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local/lib/python3.8/site-packages&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/443113?ContentTypeID=1</link><pubDate>Fri, 25 Aug 2023 07:59:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23433c9b-9dd0-40e7-9ae6-e9554ae9d2d7</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;When googling the encoding error, it looks like it usually works to fix pythonpaths: &lt;a href="https://stackabuse.com/bytes/resolving-modulenotfounderror-no-module-named-encodings-in-python/"&gt;https://stackabuse.com/bytes/resolving-modulenotfounderror-no-module-named-encodings-in-python/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I suspect that the toolchain somehow uses your systems python instead of its own local version.&lt;br /&gt;In the Toolcahin Manager, can you click &amp;quot;Open Terminal&amp;quot; next to the toolchain version.&lt;br /&gt;Then in the terminal, use these two commands to try and see where python is set from:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;env
whereis python&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can also try to set $PYTHONPATH to make python point to the Toolchain Managers Python version.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/442986?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2023 13:14:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ed0c093-529f-47b3-87ba-99ba7a010bc3</guid><dc:creator>mlac</dc:creator><description>&lt;p&gt;I have Python&amp;nbsp;3.10.12 installed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/442941?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2023 10:33:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcebb1f6-653f-4780-998b-227ab5268726</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;I can try to give you some questions which might figure out the issue.&lt;/p&gt;
&lt;p&gt;Lets start with: Which python version(s) do you have installed on your computer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/442890?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2023 07:53:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c012e31-fe0a-4140-a775-8ad362ea6f97</guid><dc:creator>mlac</dc:creator><description>&lt;p&gt;Linux Mint is based on Ubuntu, and specifically, Linux Mint 21.2 is based on Ubuntu 22.04 LTS, so I don&amp;#39;t think this issue is specific to Linux Mint.&lt;/p&gt;
&lt;p&gt;Would you reconsider your support? Manual installation is not my preference, and I&amp;#39;d only use it as a last resort.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/442871?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2023 06:34:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c817204e-f11f-4555-9dee-0c5088982623</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="mlac"]I&amp;#39;m using the nRF Connect SDK 2.4.1 on Linux Mint 21.2[/quote]
&lt;p&gt;Here are a list of the operating systems we officially support for our tooling: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/installation/recommended_versions.html#supported-operating-systems"&gt;Supported operating systems&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Because of this, we can not guarantee that the Toolchain Manager works on Mint, and I can not assist much.&lt;br /&gt;However, the manual install should still work fine. I also run on a Linux distro other than Ubuntu and I the manual install works fine for me.&lt;/p&gt;
&lt;p&gt;I have created an unofficial experimental installer script at &lt;a href="https://gitlab.com/hellesvik/nrf-connect-sdk-installer,"&gt;https://gitlab.com/hellesvik/nrf-connect-sdk-installer,&lt;/a&gt; which does manual installation steps (except for pip requirements) for you.&lt;br /&gt;If you want you can try this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/442813?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 15:05:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b002cb12-f3aa-44e6-81d9-0208659c25dd</guid><dc:creator>mlac</dc:creator><description>&lt;p&gt;I have the same issue, which breaks the build process.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using the nRF Connect SDK 2.4.1 on Linux Mint 21.2. In Toolchain Manager, I open the terminal for nRF Connect SDK v2.4.1, then:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ python
Python path configuration:
  PYTHONHOME = &amp;#39;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local&amp;#39;
  PYTHONPATH = &amp;#39;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local/lib/python3.8/site-packages&amp;#39;
  program name = &amp;#39;python&amp;#39;
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = &amp;#39;/usr/bin/python&amp;#39;
  sys.base_prefix = &amp;#39;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local&amp;#39;
  sys.base_exec_prefix = &amp;#39;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local&amp;#39;
  sys.platlibdir = &amp;#39;lib&amp;#39;
  sys.executable = &amp;#39;/usr/bin/python&amp;#39;
  sys.prefix = &amp;#39;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local&amp;#39;
  sys.exec_prefix = &amp;#39;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local&amp;#39;
  sys.path = [
    &amp;#39;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local/lib/python3.8/site-packages&amp;#39;,
    &amp;#39;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local/lib/python310.zip&amp;#39;,
    &amp;#39;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local/lib/python3.10&amp;#39;,
    &amp;#39;/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local/lib/python3.10/lib-dynload&amp;#39;,
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named &amp;#39;encodings&amp;#39;

Current thread 0x00007f437c825280 (most recent call first):
  &amp;lt;no Python frame&amp;gt;
  
$ python --version
Python 3.10.12

$ python3 --version
Python 3.8.2

$ whereis python
python: /usr/bin/python /usr/share/python /usr/share/man/man1/python.1.gz

$ whereis python3
python3: /usr/bin/python3 /usr/lib/python3 /etc/python3 /usr/share/python3 /home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local/bin/python3 /usr/share/man/man1/python3.1.gz

$ echo $PATH
/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/bin:/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/bin:/home/laci/projects/ncs/toolchains/1f9b40e71a/usr/local/bin:/home/laci/projects/ncs/toolchains/1f9b40e71a/opt/bin:/home/laci/projects/ncs/toolchains/1f9b40e71a/opt/nanopb/generator-bin:/home/laci/projects/ncs/toolchains/1f9b40e71a/opt/zephyr-sdk/aarch64-zephyr-elf/bin:/home/laci/projects/ncs/toolchains/1f9b40e71a/opt/zephyr-sdk/x86_64-zephyr-elf/bin:/home/laci/projects/ncs/toolchains/1f9b40e71a/opt/zephyr-sdk/arm-zephyr-eabi/bin:/tmp/.mount_nrfcongdGUKx:/tmp/.mount_nrfcongdGUKx/usr/sbin:/home/laci/.nvm/versions/node/v16.13.0/bin:/home/laci/.local/bin:/home/laci/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/laci/bin:/usr/local/bin:/sbin:/usr/sbin:/home/laci/.local/bin:/home/laci/bin:/usr/local/bin:/sbin:/usr/sbin:/home/laci/.local/bin:/home/laci/bin:/usr/local/bin:/sbin:/usr/sbin:/home/laci/.local/bin:/home/laci/bin:/usr/local/bin:/sbin:/usr/sbin:/home/laci/.local/bin
laci@lian:~/projects/ncs/v2.4.1$ 
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;want to refrain from manual installation and would much rather rely on the Toolchain Manager to install further SDK versions easily.&lt;/p&gt;
&lt;p&gt;Thanks in advance for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/425282?ContentTypeID=1</link><pubDate>Fri, 12 May 2023 09:59:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:581ded71-4650-42b6-95ca-e5ddbbb47bcb</guid><dc:creator>Guilherme Costa</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;There you go:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;python --version
Python 3.8.2

python3 --version
Python 3.8.2

whereis python
python: /usr/bin/python /home/guilherme/ncs/toolchains/v2.3.0/usr/local/bin/python /usr/share/man/man1/python.1.gz

whereis python3
python3: /usr/bin/python3 /usr/lib/python3 /etc/python3 /usr/share/python3 /home/guilherme/ncs/toolchains/v2.3.0/usr/local/bin/python3 /usr/share/man/man1/python3.1.gz

echo $PATH
/home/guilherme/ncs/toolchains/v2.3.0/usr/bin:/home/guilherme/ncs/toolchains/v2.3.0/usr/bin:/home/guilherme/ncs/toolchains/v2.3.0/usr/local/bin:/home/guilherme/ncs/toolchains/v2.3.0/opt/bin:/home/guilherme/ncs/toolchains/v2.3.0/opt/nanopb/generator-bin:/home/guilherme/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin:/home/guilherme/.nvm/versions/node/v18.11.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/guilherme/.dotnet/tools:/home/guilherme/.local/bin&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am on Ubuntu 22.04, using nRF Connect 4.0.1 and Toolchain Manager 1.2.4.&lt;br /&gt;&lt;br /&gt;I stopped having the problem, though. I think it might have something to do with exporting and running the env.sh from the toolchain manager.&lt;br /&gt;&lt;br /&gt;My colleagues had the same issue, and one of them made it go away by unsetting the PYTHONHOME variable after opening the terminal from the Toolchain Manager.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK: ModuleNotFoundError: No module named 'encodings'</title><link>https://devzone.nordicsemi.com/thread/424798?ContentTypeID=1</link><pubDate>Wed, 10 May 2023 10:57:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d743455-b84d-4703-b0cd-86ca784dace4</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;This looks like a path issue.&lt;/p&gt;
&lt;p&gt;Can you do the following commands?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;python --version
python --version
whereis python
whereis python3
echo $PATH
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Which operating system do you use?&lt;/p&gt;
&lt;p&gt;Which version of the Toolchain Manager do you use?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>