Talk:ModuleNotFoundError: Difference between revisions
IndianaM1ke (talk | contribs) (reword into again for more OS clarify) |
(clarify instructions) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
<!-- | <!-- | ||
proposed revisions by Barry Duggan | |||
02/08/2020 | |||
--> | |||
When you start gnuradio-companion or execute grcc, if the system isn't configured properly for GRC to find the GNU Radio Python scripts and/or libraries, then you will see an error message similar to this one: | When you start gnuradio-companion or execute grcc, if the system isn't configured properly for GRC to find the GNU Radio Python scripts and/or libraries, then you will see an error message similar to this one: | ||
Line 16: | Line 16: | ||
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>{ | then use that prefix in place of <code>{your-prefix}</code> in the following commands. | ||
== B. Finding the Python library == | == B. Finding the Python library == | ||
Using your file manager, look in <code>{ | Using your file manager, look in <code>{your-prefix}/lib</code> for a directory to match your Python version which has a directory <code>dist-packages</code> which has a directory <code>gnuradio</code>. For example, if you found <code>/usr/local/lib/python3/dist-packages/gnuradio</code>, then you would use <code>python3</code> <b>in place of</b> <code>{Py-version}</code> in the following commands. | ||
== C. Setting PYTHONPATH == | == C. Setting PYTHONPATH == | ||
Line 26: | Line 26: | ||
- For almost all Debian / Ubuntu (and derivative) systems, and most other 32-bit Unix/Linux systems, use: | - For almost all Debian / Ubuntu (and derivative) systems, and most other 32-bit Unix/Linux systems, use: | ||
<pre> | <pre> | ||
export PYTHONPATH={ | export PYTHONPATH={your-prefix}/lib/{Py-version}/dist-packages:{your-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={ | export PYTHONPATH={your-prefix}/lib64/{Py-version}/site-packages:$PYTHONPATH | ||
</pre> | </pre> | ||
Line 38: | Line 38: | ||
- For almost all Debian / Ubuntu (and derivative) systems, and most other 32-bit Unix/Linux systems, use: | - For almost all Debian / Ubuntu (and derivative) systems, and most other 32-bit Unix/Linux systems, use: | ||
<pre> | <pre> | ||
export LD_LIBRARY_PATH={ | export LD_LIBRARY_PATH={your-prefix}/lib:$LD_LIBRARY_PATH | ||
</pre> | </pre> | ||
- For other 64-bit systems, use: | - For other 64-bit systems, use: | ||
<pre> | <pre> | ||
export LD_LIBRARY_PATH={ | export LD_LIBRARY_PATH={your-prefix}/lib64:$LD_LIBRARY_PATH | ||
</pre> | </pre> | ||
== E. Store the commands in a Bash start-up file == | == E. 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 <code>~/. | Once you have determined the correct two export commands to use, open your text editor and put them in your <code>~/.bash_aliases</code> or <code>~/.bashrc</code> or <code>~/.profile</code> file. Save the file. On your terminal enter <code>exit</code>. Then start a new terminal.<br> | ||
As an example, your entries might be: | |||
<pre> | |||
export PYTHONPATH=/usr/local/lib/python3/dist-packages:$PYTHONPATH | |||
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH | |||
</pre> |
Revision as of 02:42, 9 February 2020
When you start gnuradio-companion or execute grcc, if the system isn't configured properly for GRC to find the GNU Radio Python scripts and/or libraries, then you will see an error message similar to this one:
If you get this error message and you're running Linux, try the instructions on this page to see if any of them fix the issue. For issues and settings for OSX, see the MacInstall guide.
A. Determine the GNU Radio install 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 {your-prefix}
in the following commands.
B. Finding the Python library
Using your file manager, look in {your-prefix}/lib
for a directory to match your Python version which has a directory dist-packages
which has a directory gnuradio
. For example, if you found /usr/local/lib/python3/dist-packages/gnuradio
, then you would use python3
in place of {Py-version}
in the following commands.
C. Setting PYTHONPATH
- For almost all Debian / Ubuntu (and derivative) systems, and most other 32-bit Unix/Linux systems, use:
export PYTHONPATH={your-prefix}/lib/{Py-version}/dist-packages:{your-prefix}/lib/{Py-version}/site-packages:$PYTHONPATH
- For other 64-bit systems, use:
export PYTHONPATH={your-prefix}/lib64/{Py-version}/site-packages:$PYTHONPATH
D. 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={your-prefix}/lib:$LD_LIBRARY_PATH
- For other 64-bit systems, use:
export LD_LIBRARY_PATH={your-prefix}/lib64:$LD_LIBRARY_PATH
E. 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 ~/.bash_aliases
or ~/.bashrc
or ~/.profile
file. Save the file. On your terminal enter exit
. Then start a new terminal.
As an example, your entries might be:
export PYTHONPATH=/usr/local/lib/python3/dist-packages:$PYTHONPATH export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH