Talk:ModuleNotFoundError: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
When you start gnuradio-companion or execute grcc, if you get this, or a similar, error message:
__NOTOC__
<!--
ModuleNotFoundError.mediawiki
revised 01/29/2020
-->


<b>When you start gnuradio-companion or execute grcc, and you get this, or a similar, error message:</b>
<br><br>
[[File:ModNotFound.png|300px]]
[[File:ModNotFound.png|300px]]
<br><br>
<b>then perform the following steps.</b>


then put the following 'export' commands in your <code>~/.bashrc</code> or <code>~/.profile</code> or <code>~/.bash_aliases</code> file and restart your terminal.<br>
== A. Mac OSX / macOS ==


= Determine your installation prefix =
See the [https://wiki.gnuradio.org/index.php/MacInstall#Typical_Errors_and_Warnings MacInstall] guide for issues and settings for that OS.
 
== B. Determine your installation prefix ==


If you don't know or remember your installation prefix, perform the following step:
If you don't know or remember your installation prefix, perform the following step:
*  on a terminal screen, enter <code>gnuradio-config-info --prefix</code>
*  on a terminal screen, enter <code>gnuradio-config-info --prefix</code>
then use that prefix in place of <code>{prefix}</code> in the following commands
then use that prefix in place of <code>{prefix}</code> in the following commands.
 
== C. Finding the Python library ==
 
Using your file manager, look in <code>{prefix}/lib</code> for a sub-directory to match your Python version.<br>
for example, <code>python2.7</code> or <code>python3</code>. Use that name in place of <code>{py-version}</code> in the following commands.


= Setting PYTHONPATH =
== D. Setting PYTHONPATH ==


== Linux-based systems and MacOSX / macOS ==
-  For almost all Debian / Ubuntu (and derivative) systems, and most other 32-bit Unix/Linux systems, use:
-  For MacOSX / macOS, most Debian / Ubuntu (and derivative) systems, and most other 32-bit Unix/Linux systems, use:
<pre>
<pre>
export PYTHONPATH={prefix}/lib/python3/dist-packages:{prefix}/lib/python3/site-packages:$PYTHONPATH
export PYTHONPATH={prefix}/lib/{py-version}/dist-packages:{prefix}/lib/{py-version}/site-packages:$PYTHONPATH
</pre>
</pre>


-  For other 64-bit systems, use:
-  For other 64-bit systems, use:
<pre>
<pre>
export PYTHONPATH={prefix}/lib64/python3/site-packages:$PYTHONPATH
export PYTHONPATH={prefix}/lib64/{py-version}/site-packages:$PYTHONPATH
</pre>
</pre>


= Setting LD_LIBRARY_PATH =
== E. Setting LD_LIBRARY_PATH ==


== Linux-based systems ==
-  For almost all Debian / Ubuntu (and derivative) systems, and most other 32-bit Unix/Linux systems, use:
-  For most 32-bit systems and most Debian / Ubuntu (and derivative) systems, use:
<pre>
<pre>
export LD_LIBRARY_PATH={prefix}/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH={prefix}/lib:$LD_LIBRARY_PATH
Line 37: Line 50:
</pre>
</pre>


== MacOSX / macOS ==
== F. Store the commands in a Bash start-up file ==
On MacOSX / macOS, the library search path is set primarily by the environment variable DYLD_LIBRARY_PATH. Because of the way the OSX dynamic library loader works, this variable works differently than on Linux. Its primary purpose is in finding libraries in a local path, such as when testing software before installing it, or inside an application. <b>We strongly recommend against setting this variable globally.</b>
 
Once you have determined the correct two export commands to use, open your text editor and put them in your <code>~/.profile</code> or <code>~/.bash_aliases</code> or <code>~/.bashrc</code> file and restart your terminal.<br>

Revision as of 23:29, 29 January 2020


When you start gnuradio-companion or execute grcc, and you get this, or a similar, error message:

ModNotFound.png

then perform the following steps.

A. Mac OSX / macOS

See the MacInstall guide for issues and settings for that OS.

B. Determine your installation prefix

If you don't know or remember your installation prefix, perform the following step:

  • on a terminal screen, enter gnuradio-config-info --prefix

then use that prefix in place of {prefix} in the following commands.

C. Finding the Python library

Using your file manager, look in {prefix}/lib for a sub-directory to match your Python version.
for example, python2.7 or python3. Use that name in place of {py-version} in the following commands.

D. Setting PYTHONPATH

- For almost all Debian / Ubuntu (and derivative) systems, and most other 32-bit Unix/Linux systems, use:

export PYTHONPATH={prefix}/lib/{py-version}/dist-packages:{prefix}/lib/{py-version}/site-packages:$PYTHONPATH

- For other 64-bit systems, use:

export PYTHONPATH={prefix}/lib64/{py-version}/site-packages:$PYTHONPATH

E. Setting LD_LIBRARY_PATH

- For almost all Debian / Ubuntu (and derivative) systems, and most other 32-bit Unix/Linux systems, use:

export LD_LIBRARY_PATH={prefix}/lib:$LD_LIBRARY_PATH

- For other 64-bit systems, use:

export LD_LIBRARY_PATH={prefix}/lib64:$LD_LIBRARY_PATH

F. Store the commands in a Bash start-up file

Once you have determined the correct two export commands to use, open your text editor and put them in your ~/.profile or ~/.bash_aliases or ~/.bashrc file and restart your terminal.