Environment in Ubuntu (and PyCharm) terminal does not match editor window. How can I ensure an exact match?
Answered
If I use the Ubuntu terminal to start Python2.7, I can import the modules I need, and all functions are available to me. They are also available to me when I start ipython from within the PyCharm terminal window. But when I import them into my python code, it tells me it cannot find the functions, which makes coding more difficult. How can i ensure an exact match between the environments in the editor and the terminal windows of PyCharm?
Please sign in to leave a comment.
Hello!
Please run this script in Pycharm and in Terminal to compare environment: https://gist.github.com/vlasovskikh/968240f877117cb6c882.
Hi Anna,
Thanks for that - very interesting results. I ran the script using...
Most of the folders were shared across all three PATHs. However, [1] lacked "/home/<user>/Programmes/pymol/bin", and lacked "/usr/games", neither of which explains the issues I'm having with rdkit usage inside PyCharm.
I am able to run rdkit using the PyCharm terminal [2] and Ubuntu terminal [3], but not the standard PyCharm run function. The only difference I can see using your script is that the sys.path order is slightly different in [1] compared to [2] & [3]. rdkit-Release appears first in [1], but the other way around in [2] and [3] (also in this order (rdkit second) in PYTHONPATH). I'm not sure how important this is.
I had some difficulty with the installation of rdkit, and needed to specify the "LD_LIBRARY_PATH" variable:
[2 - PyCharm terminal LD_LIBRARY_PATH]
[1 - PyCharm run LD_LIBRARY_PATH]
[3 - Ubuntu terminal LD_LIBRARY_PATH]
How can I force PyCharm 'run' to see the LD_LIBRARY_PATH? And PYTHONPATH?
Thanks,
Ant