Skip to main content
Bumped by Community user
Bumped by Community user
Notice removed Canonical answer required by CommunityBot
Bounty Ended with no winning answer by CommunityBot
added 153 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31

I have a similar Ubuntu 14.04 VM working, would it be possible to rsync certain folders to it so that the non-working Ubuntu 14.04 is back to normal?

I have a similar Ubuntu 14.04 VM working, would it be possible to rsync certain folders to it so that the non-working Ubuntu 14.04 is back to normal?

added 16661 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31

The contents of $PYTHONPATH before doing any source'ing are empty.

The contents of Downloads/dx-toolkit/environment are below:

# -*- Mode: shell-script -*-                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
# Copyright (C) 2013-2016 DNAnexus, Inc.                                                                                                                                                                                                                                                                                                                                                                                                                                                       
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
# This file is part of dx-toolkit (DNAnexus platform client libraries).                                                                                                                                                                                                                                                                                                                                                                                                                        
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
#   Licensed under the Apache License, Version 2.0 (the "License"); you may not                                                                                                                                                                                                                                                                                                                                                                                                                
#   use this file except in compliance with the License. You may obtain a copy                                                                                                                                                                                                                                                                                                                                                                                                                 
#   of the License at                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
#       http://www.apache.org/licenses/LICENSE-2.0                                                                                                                                                                                                                                                                                                                                                                                                                                             
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
#   Unless required by applicable law or agreed to in writing, software                                                                                                                                                                                                                                                                                                                                                                                                                        
#   distributed under the License is distributed on an "AS IS" BASIS, WITHOUT                                                                                                                                                                                                                                                                                                                                                                                                                  
#   WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the                                                                                                                                                                                                                                                                                                                                                                                                                   
#   License for the specific language governing permissions and limitations                                                                                                                                                                                                                                                                                                                                                                                                                    
#   under the License.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
# Source this file in a bash shell to initialize DNAnexus environment                                                                                                                                                                                                                                                                                                                                                                                                                          
# variables:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
# $ source environment                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

# This line is compatible with both bash and csh/tcsh. If running in csh, it sources the file "environment.csh" and quits.                                                                                                                                                                                                                                                                                                                                                                     

test ! -z "$version" && echo "$shell" | grep -q csh && set SOURCE=`echo $_ | cut -f 2 -d " "` && set SOURCE=`dirname "$SOURCE"` && source "$SOURCE/environment.csh" && exit

# Resolve the location of this file                                                                                                                                                                                                                                                                                                                                                                                                                                                            
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done

# Get RHEL version                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
if [ -e /etc/redhat-release ] ; then
  RHEL_MAJOR_VERSION=$(grep -o "Red Hat Enterprise Linux .* release [0-9]\+" /etc/redhat-release | sed -e "s/Red Hat Enterprise Linux .* release //")
fi

export DNANEXUS_HOME="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Detect system installation of dx-toolkit                                                                                                                                                                                                                                                                                                                                                                                                                                                     
if [ "$DNANEXUS_HOME" == "/etc/profile.d" ]; then

  export DNANEXUS_HOME="/usr/share/dnanexus"
  # Private Python packages. We really ought not pollute PYTHONPATH with these though.                                                                                                                                                                                                                                                                                                                                                                                                         
  export PYTHONPATH="/usr/share/dnanexus/lib/python2.7/site-packages:$PYTHONPATH"
  export CLASSPATH="/usr/share/java/dnanexus-api-0.1.0.jar:${CLASSPATH}"

else

  export PATH="${DNANEXUS_HOME}/bin:$PATH"
  export CLASSPATH="${DNANEXUS_HOME}/lib/java/*:${CLASSPATH}"

  if [ "$RHEL_MAJOR_VERSION" == "7" ]; then
    export PYTHONPATH="${DNANEXUS_HOME}/share/dnanexus/lib/python2.7/site-packages:${DNANEXUS_HOME}/lib64/python2.7/site-packages:$PYTHONPATH"
  else
    export PYTHONPATH="${DNANEXUS_HOME}/share/dnanexus/lib/python2.7/site-packages:${DNANEXUS_HOME}/lib/python:$PYTHONPATH"
  fi

fi

# Note: The default I/O stream encoding in Python 2.7 (as configured on ubuntu) is ascii, not UTF-8 or the system locale                                                                                                                                                                                                                                                                                                                                                                       
# encoding. We reset it here to avoid having to set it for every I/O operation explicitly.                                                                                                                                                                                                                                                                                                                                                                                                     
export PYTHONIOENCODING=UTF-8

eval "$(register-python-argcomplete dx|sed 's/-o default//')"

# Clean up old session files                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
(shopt -s nullglob;
 if [[ $HOME != "" ]]; then
     for session_dir in "${HOME}/.dnanexus_config/sessions/"*; do
         if ! ps -p $(basename "$session_dir") &> /dev/null; then
             rm -rf "$session_dir"
         fi
     done
 fi
)

if [[ -z "$DX_SECURITY_CONTEXT" && -n "$DX_AUTH_TOKEN" ]]; then
    export DX_SECURITY_CONTEXT="{\"auth_token_type\":\"Bearer\",\"auth_token\":\"$DX_AUTH_TOKEN\"}"
fi

The contents of $PYTHONPATH before doing any source'ing are empty.

The contents of Downloads/dx-toolkit/environment are below:

# -*- Mode: shell-script -*-                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
# Copyright (C) 2013-2016 DNAnexus, Inc.                                                                                                                                                                                                                                                                                                                                                                                                                                                       
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
# This file is part of dx-toolkit (DNAnexus platform client libraries).                                                                                                                                                                                                                                                                                                                                                                                                                        
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
#   Licensed under the Apache License, Version 2.0 (the "License"); you may not                                                                                                                                                                                                                                                                                                                                                                                                                
#   use this file except in compliance with the License. You may obtain a copy                                                                                                                                                                                                                                                                                                                                                                                                                 
#   of the License at                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
#       http://www.apache.org/licenses/LICENSE-2.0                                                                                                                                                                                                                                                                                                                                                                                                                                             
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
#   Unless required by applicable law or agreed to in writing, software                                                                                                                                                                                                                                                                                                                                                                                                                        
#   distributed under the License is distributed on an "AS IS" BASIS, WITHOUT                                                                                                                                                                                                                                                                                                                                                                                                                  
#   WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the                                                                                                                                                                                                                                                                                                                                                                                                                   
#   License for the specific language governing permissions and limitations                                                                                                                                                                                                                                                                                                                                                                                                                    
#   under the License.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
#                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
# Source this file in a bash shell to initialize DNAnexus environment                                                                                                                                                                                                                                                                                                                                                                                                                          
# variables:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
# $ source environment                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

# This line is compatible with both bash and csh/tcsh. If running in csh, it sources the file "environment.csh" and quits.                                                                                                                                                                                                                                                                                                                                                                     

test ! -z "$version" && echo "$shell" | grep -q csh && set SOURCE=`echo $_ | cut -f 2 -d " "` && set SOURCE=`dirname "$SOURCE"` && source "$SOURCE/environment.csh" && exit

# Resolve the location of this file                                                                                                                                                                                                                                                                                                                                                                                                                                                            
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done

# Get RHEL version                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
if [ -e /etc/redhat-release ] ; then
  RHEL_MAJOR_VERSION=$(grep -o "Red Hat Enterprise Linux .* release [0-9]\+" /etc/redhat-release | sed -e "s/Red Hat Enterprise Linux .* release //")
fi

export DNANEXUS_HOME="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# Detect system installation of dx-toolkit                                                                                                                                                                                                                                                                                                                                                                                                                                                     
if [ "$DNANEXUS_HOME" == "/etc/profile.d" ]; then

  export DNANEXUS_HOME="/usr/share/dnanexus"
  # Private Python packages. We really ought not pollute PYTHONPATH with these though.                                                                                                                                                                                                                                                                                                                                                                                                         
  export PYTHONPATH="/usr/share/dnanexus/lib/python2.7/site-packages:$PYTHONPATH"
  export CLASSPATH="/usr/share/java/dnanexus-api-0.1.0.jar:${CLASSPATH}"

else

  export PATH="${DNANEXUS_HOME}/bin:$PATH"
  export CLASSPATH="${DNANEXUS_HOME}/lib/java/*:${CLASSPATH}"

  if [ "$RHEL_MAJOR_VERSION" == "7" ]; then
    export PYTHONPATH="${DNANEXUS_HOME}/share/dnanexus/lib/python2.7/site-packages:${DNANEXUS_HOME}/lib64/python2.7/site-packages:$PYTHONPATH"
  else
    export PYTHONPATH="${DNANEXUS_HOME}/share/dnanexus/lib/python2.7/site-packages:${DNANEXUS_HOME}/lib/python:$PYTHONPATH"
  fi

fi

# Note: The default I/O stream encoding in Python 2.7 (as configured on ubuntu) is ascii, not UTF-8 or the system locale                                                                                                                                                                                                                                                                                                                                                                       
# encoding. We reset it here to avoid having to set it for every I/O operation explicitly.                                                                                                                                                                                                                                                                                                                                                                                                     
export PYTHONIOENCODING=UTF-8

eval "$(register-python-argcomplete dx|sed 's/-o default//')"

# Clean up old session files                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
(shopt -s nullglob;
 if [[ $HOME != "" ]]; then
     for session_dir in "${HOME}/.dnanexus_config/sessions/"*; do
         if ! ps -p $(basename "$session_dir") &> /dev/null; then
             rm -rf "$session_dir"
         fi
     done
 fi
)

if [[ -z "$DX_SECURITY_CONTEXT" && -n "$DX_AUTH_TOKEN" ]]; then
    export DX_SECURITY_CONTEXT="{\"auth_token_type\":\"Bearer\",\"auth_token\":\"$DX_AUTH_TOKEN\"}"
fi
added 770 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31

After doing unset PYTHON, then:

>>> import sys
>>> sys.path
['', '/usr/local/lib/python2.7/dist-packages/multiqc-1.4dev-py2.7.egg', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7', '/home/avilella/Downloads/dx-toolkit/share/dnanexus/lib/python2.7/site-packages', '/home/avilella/Downloads/dx-toolkit/lib/python', '/home/avilella', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/avilella/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']

unset PYTHON, the python3:

>>> import sys
>>> sys.path
['', '/home/avilella/Downloads/dx-toolkit/share/dnanexus/lib/python2.7/site-packages', '/home/avilella/Downloads/dx-toolkit/lib/python', '/home/avilella', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu', '/usr/lib/python3.4/lib-dynload', '/usr/local/lib/python3.4/dist-packages', '/usr/lib/python3/dist-packages']

After doing unset PYTHON, then:

>>> import sys
>>> sys.path
['', '/usr/local/lib/python2.7/dist-packages/multiqc-1.4dev-py2.7.egg', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7', '/home/avilella/Downloads/dx-toolkit/share/dnanexus/lib/python2.7/site-packages', '/home/avilella/Downloads/dx-toolkit/lib/python', '/home/avilella', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/avilella/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']

unset PYTHON, the python3:

>>> import sys
>>> sys.path
['', '/home/avilella/Downloads/dx-toolkit/share/dnanexus/lib/python2.7/site-packages', '/home/avilella/Downloads/dx-toolkit/lib/python', '/home/avilella', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu', '/usr/lib/python3.4/lib-dynload', '/usr/local/lib/python3.4/dist-packages', '/usr/lib/python3/dist-packages']
Tweeted twitter.com/StackUnix/status/937684449759768576
Notice added Canonical answer required by 719016
Bounty Started worth 250 reputation by 719016
added 444 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31
Loading
added 155 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31
Loading
added 1739 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31
Loading
added 311 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31
Loading
added 311 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31
Loading
added 311 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31
Loading
added 77 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31
Loading
added 527 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31
Loading
added 305 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31
Loading
added 153 characters in body
Source Link
719016
  • 721
  • 3
  • 17
  • 31
Loading
Source Link
719016
  • 721
  • 3
  • 17
  • 31
Loading