Talk:ModuleNotFoundError: Difference between revisions
IndianaM1ke (talk | contribs) (Tweak variable substitution to CAPS and fix Python directory to be full MAJOR.MINOR) |
IndianaM1ke (talk | contribs) (Change wording in intro) |
||
Line 5: | Line 5: | ||
--> | --> | ||
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: | |||
<br><br> | <br><br> | ||
[[File:ModNotFound.png|300px]] | [[File:ModNotFound.png|300px]] | ||
<br><br> | <br><br> | ||
< | |||
If you get this error message, try changing your shell environment settings as per the instructions below to see if either changing the <code>PYTHONPATH</code> or <code>LD_LIBRARY_PATH</code> fixes the issue. | |||
== A. Mac OSX / macOS == | == A. Mac OSX / macOS == | ||
See the [https://wiki.gnuradio.org/index.php/MacInstall#Typical_Errors_and_Warnings MacInstall] guide for issues and settings for | See the [https://wiki.gnuradio.org/index.php/MacInstall#Typical_Errors_and_Warnings MacInstall] guide for issues and settings for OSX. | ||
== B. Determine your installation prefix == | == B. Determine your installation prefix == |
Revision as of 14:25, 30 January 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, try changing your shell environment settings as per the instructions below to see if either changing the PYTHONPATH
or LD_LIBRARY_PATH
fixes the issue.
A. Mac OSX / macOS
See the MacInstall guide for issues and settings for OSX.
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 directory to match your Python version. For example, python2.7
or python3.7
; note the combination of python
and the version as {major}.{minor}
, which is used by all Python installs by default. Use that directory 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.