Open Sec42 opened 4 years ago
I'm not sure if I'm being pedantic here, but the fix is just to insert the new python libraries.
After a successful 3.8 install using the command sequence:
sudo apt-get install python-pip sudo pip install pybombs pybombs auto-config pybombs recipes add-defaults pybombs prefix init ~/gnuradio -R gnuradio-default (wait a while) . ~/gnuradio/setup_env.sh gnuradio-companion
gnu radio-companion will not run. The python path in the setup_env.sh does not reference the python 3 and python 3.7 site-packages directories. To fix, add the correct python path information including the new python 3 and 3.7 site-packages directories to the PYTHONPATH environment variable e.g.:
export PYTHONPATH="/home/cclamb/gnuradio/lib/python3/dist-packages:/home/cclamb/gnuradio/lib/python3.7/dist-packages:/home/cclamb/gnuradio/python:/home/cclamb/gnuradio/lib/python2.6/site-packages:/home/cclamb/gnuradio/lib64/python2.6/site-packages:/home/cclamb/gnuradio/ lib/python2.6/dist-packages:/home/cclamb/gnuradio/lib64/python2.6/dist-packages:/home/cclamb/gnuradio/lib/python2.7/site-packages:/home/cclamb/gnuradio/lib64/python2.7/site-packages:/home/cclamb/gnuradio/lib/python2.7/dist-packages:/home/cclamb/gnuradio/lib64/python2.7/dist-packages:$PYTHONPATH"
Same problem on Ubuntu 18.04.2 LTS
This is still broken on Ubuntu 19.10. The issue that pybombs creates a broken PYTHONPATH only listing python2 paths (which do not exist at all) remains.
A quick edit to setup_env.sh removing all python2 references, and replacing them with python3 seems to make the installation work.
On my "Ubuntu 18.04.3 LTS" the following happens when installing 3.8 for Python 3 via PyBOMBS:
$PREFIX/lib/python3/dist-packages/
$PREFIX/lib/python3/dist-packages
setup_env.sh
adds $PREFIX/lib/python3.6/site-packages
,$PREFIX/lib/python3.6/dist-packages
,$PREFIX/lib64/python3.6/site-packages
and $PREFIX/lib64/python3.6/dist-packages
setup_env.sh
does not add $PREFIX/lib/python3/dist-packages
leading to Python not finding gnuradio.
Commands executed:
sudo pip3 install --upgrade git+https://github.com/gnuradio/pybombs.git
pybombs auto-config
pybombs recipes add-defaults
pybombs prefix init ~/gr-3.8 -R gnuradio-default
I've observed the same behaviour as schneider42.
It appears that pybombs is incorrectly generating the python paths to dist-packages.
I'm successfully working around this issue by manually editing the setup_env.sh to change references to 'python3.6/dist-packages' into 'python3/dist-packages'.
gnuradio-companion works fine after the edit and I no longer receive an error when I import gnuradio into my python scripts.
I have also found it broken on Ubuntu 19.10 after using the Quick Start on a fresh OS install.
The specific edit I needed to get gnuradio-companion
to run is:
--- setup_env.sh.orig 2020-02-21 20:44:00.694360807 +0000
+++ setup_env.sh 2020-02-21 20:46:00.295175376 +0000
@@ -1,6 +1,6 @@
# WARNING: This file is auto-generated by pybombs, any manual changes to it may be overwritten!
export PATH="/home/gareth/gr38/bin:$PATH"
-export PYTHONPATH="/home/gareth/gr38/lib/python3.7/site-packages:/home/gareth/gr38/lib/python3.7/dist-packages:/home/gareth/gr38/lib64/python3.7/site-packages:/home/gareth/gr38/lib64/python3.7/dist-packages:$PYTHONPATH"
+export PYTHONPATH="/home/gareth/gr38/lib/python3/dist-packages:/home/gareth/gr38/lib/python3.7/site-packages:/home/gareth/gr38/lib/python3.7/dist-packages:/home/gareth/gr38/lib64/python3.7/site-packages:/home/gareth/gr38/lib64/python3.7/dist-packages:$PYTHONPATH"
export LD_LIBRARY_PATH="/home/gareth/gr38/lib:/home/gareth/gr38/lib64/:$LD_LIBRARY_PATH"
export LIBRARY_PATH="/home/gareth/gr38/lib:/home/gareth/gr38/lib64/:$LIBRARY_PATH"
export PKG_CONFIG_PATH="/home/gareth/gr38/lib/pkgconfig:/home/gareth/gr38/lib64/pkgconfig:$PKG_CONFIG_PATH"
Still occurring.
gareth8118 seems to have a correct fix. site-packages and dist-packages are installed in separate python3 and python3.x directories. It is a quick fix on Ubuntu 18.04. Note this was NOT an issue when using python2 and gnuradio-stable.
Still occurring on Ubuntu 18.04.5 with PyBOMBS 2.3.4. As the default is Python 2.7, the generated PYTHONPATH consisted of (all non-existing!) .../python2*/... paths, even though GR 3.8 uses Python 3. I was also able to fix it with Gareth's edit, including Python 3.6 path correction (Ubuntu 18.04).
i ave the solution...do first: sudo apt-get install python3-setuptools
In my case, python3-setuptools were installed as well as python-setuptools (python2-setuptools). There is probably something wrong with the PYTHONPATH derivation logic in PyBOMBS.
As a workaround, run the following snipped after pybombs prefix init
inside you new prefix:
( # Fix pybombs paths
python=python3
maj=$($python -V 2>&1 |tr . ' '|cut -d ' ' -f 2)
min=$($python -V 2>&1 |tr . ' '|cut -d ' ' -f 3)
echo -n "export PYTHONPATH="
for ver in $maj $maj.$min ; do
for lib in lib lib64 ; do
for pkg in site dist ; do
echo -n $(pwd)/${lib}/python${ver}/${pkg}-packages:
done
done
done
echo '${PYTHONPATH}'
) >>setup_env.sh
It grabs the correct version number from your python binary and adds the proper paths.
After following the documented steps of
the resulting gnuradio installation does not work:
No indication of warnings or errors is given during installation:
Logs:
Versions:
As far as I can tell, this is due to gnuradio building against python3 whereas pybombs assumes it built for python2.
and