Issue
I am using a package that requires me to add the following line to my bashrc
export PATH=${PATH}:~/cozmo/plataform-tools
It works perfectly when I call python3 or ipython3 from the command line. However, when I start Spyder by double clicking a python file in Nautilus, it cannot find and execute a required file that is inside that folder. So, my question is
How to make the spyder console to use the PATH set at my bashr? Or how to set the path inside spyder?
I am aware of Why do the environment variables set in command prompt have no effect when I start Spyder, but it don't solve my problem, since I need to call it from Nautilus (and not use sudo) and I do not want to add a line declaring the path in all my programs.
Solution
I found a solution to setting a variable in ipython console. Just include
import os, os.environ['PATH']+=':/home/bernardo/cozmo/platform-tools
in Tools → Preference → iPython console → Startup → Lines. I believe a similar solution can be applied if Python console is being used instead of iPython console.
By doing this I am able to use the package that requires this path even when spyder is not started from the terminal.
Answered By - bmello
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.