Python Module Error on Linux

后端 未结 2 764
时光说笑
时光说笑 2021-02-04 15:14

I am using python 2.7 on Linux Mint 16. I am facing an error, if I run my IDE (tried it on Spyder and Pycharm) from a program launcher (eg. from the prompt at Alt F2 or an icon

2条回答
  •  抹茶落季
    2021-02-04 16:01

    You are seeing different behaviour because your .bashrc is always loaded before you launch PyCharm (or other editors) from the terminal. The other shortcuts know nothing of your .bashrc and they should not. It seems that this module requires some very interesting configuration.

    Your best bet to not have to use the terminal every time is to modify the shortcuts you're using (which is up to you to figure out) to set the proper environment variables. The most important of these variables is the LD_LIBRARY_PATH.

    export LD_LIBRARY_PATH="/opt/gurobi562/linux64/lib:/usr/local/lib/python2.7/dist-   packages/gurobipy"
    

    Warning: the dist- packages seems odd but I've copied it out of your question. If it doesn't work, it's up to you to figure out what the right directory name is.

提交回复
热议问题