Hi Folks,
I am using this command to install some packages to both Python2 and Python3.
The command run just fine, but in the notebook only python3 env is OK
All packages installed appear on pip list and conda list commands, but the import command inside a python2 notebook is not working.
Any ideas?
# 'Python3'
RUN python -m pip install transitions
RUN python -m pip install git+http://22.22.22.22/user/somepack.git
# 'Switch to Python2 and install it again'
RUN source activate python2
# 'Python2'
RUN python -m pip install transitions
RUN python -m pip install git+http://22.22.22.22/user/somepack.git
# 'Switch back to default Python3'
RUN source deactivate`
problem only happens with "somepack" library that is installed directly from git
This step:
# 'Switch to Python2 and install it again'
RUN source activate python2
is not persistent through the following commands. You'll need to add the activation into the same run statement as the pip installs.
Like this?
RUN source activate python2 && \
python -m pip install transitions && \
python -m pip install git+http://22.22.22.22/user/somepack.git
I think that's close to correct. You might need to wrap the whole thing in a bash -c "source activate ..." if that doesn't work.
@guilhermecgs Did you get it working?
Yes, worked perfectly!