Reputation: 59
Through buildozer in Ubuntu, I was running an app I am developing.
However, I faced the following error:
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: initfsencoding: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
I searched and searched and searched for an adequate method for treating this particular problem on Google. Then, I found few methods to fix this problem.
For the first attempt, I set: export PYTHONHOME=/usr/local/lib/python3.7 as suggested in the error comments. Unfortunately, the same error appeared even with this change. For the second attempt, I tried to delete virtual environment file and reset it as suggested on the following website: ImportError: No module named 'encodings'. But, again, I failed to eliminate this error.
I saw that some of the posts on Stackoverflow regarding this issue provide repetitive methods. I am stuck with this issue. I would deeply appreciate it if anyone can be kind enough to shed some light on this. Blessings.
Upvotes: 5
Views: 4057
Reputation: 6163
Follow these steps to avoid this
virtualenv
by source venv/bin/activate
ENV["PYTHON"]
to correct Python path under the virtualenvPyCall
by pip install pycall
v0.6/PyCall/deps/deps.jl
with a text editor and replace const PYTHONHOME = "..."
with const PYTHONHOME = ""
PyCall
Upvotes: 1