I am currently working on a Python project which runs on MSC board (with custom Linux OS). Even installing something as basic as virtualenv on this board needed some 'efforts'.
So, I decided to summarize the steps that helped me to get python virtual environment working on this Linux based board.
Hopefully, it might also help some other developers facing similar issues.
There are two ways to add Lib path:
So, I decided to summarize the steps that helped me to get python virtual environment working on this Linux based board.
Hopefully, it might also help some other developers facing similar issues.
- Install virtualenv package
'files. pythonhosted.org' to avoid ssl certificate errors.
However, use of this flag should be avoided in general
because it overrides some essential security checks.
python3.6 -m pip install --trusted-host=pypi.org virtualenv
--trusted-host=files. pythonhosted.org
- Define symbolic library path
We need to define path of 'libpython' symbolic library
corresponding to the Python version installed in MSC Board.
Otherwise, virtual
environment creation throws error -
“/home/root/../ ..env/bin/python3.6: error while loading shared
libraries:
libpython3.6m.so.1.0: cannot open sbelowhared
object file: No such file or directory”.
There are two ways to add Lib path:
- Adding the lib path directly to '/etc/ld.so.conf'.
In my case, the library was located at ‘/home
/root/berryconda3/lib’.
After saving the ldconfig file, activate it
/sbin/ldconfig –v
- If you don't want to modify ldconfig file directly,
export LD_LIBRARY_PATH=/home/root/ berryconda3/lib
- Create a virtualenv
Now you should be able to create a virtual environment by
running -
python3.6 -m virtualenv channelenv
- Activate virtual environment
source channelenv/bin/activate
Notice that command prompt is changed and virtual environment
name is added as suffix
(channelenv) root@msc-sm2-imx6dl:~/channels#
- Deactivate
deactivate
Comments