Hi everyone this is my first question on StackOverflow and I hope it finds everyone well. I recently started using TMUX and I'm having a problem using it for a machine learning problem set I have.
I'm creating a program using python and I'm using the sklearn module. Basically when I run the code in the terminal out my TMUX session, everything works fine. However, when I start a TMUX session and run the code, I get the following error.
Traceback (most recent call last):
File "hw1.py", line 5, in <module>
from sklearn import svm
ImportError: No module named sklearn
For some reason, it can't find sklearn even though it is installed and it works fine outside the TMUX session. Here are my import statements.
import numpy
import scipy.io
from sklearn import svm
from random import sample
Why can't it find the module while in TMUX and how do I fix this?
I ran into the same problem on OS X. It seems that the PATH variable gets messed up when you call tmux while in a non-default anaconda environment.
If I run tmux in a new terminal before calling source activate
and then activate the environment I want while in tmux then things work as expected. Unfortunately with this workaround I have to remember to call source activate
in every pane I open in tmux so it's a less than ideal solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With