Skip to content
This repository has been archived by the owner on Aug 20, 2022. It is now read-only.

spyder doesn't have PYTHONPATH when run from the Dash #12

Open
KrisThielemans opened this issue May 23, 2017 · 11 comments
Open

spyder doesn't have PYTHONPATH when run from the Dash #12

KrisThielemans opened this issue May 23, 2017 · 11 comments
Milestone

Comments

@KrisThielemans
Copy link
Member

we set PYTHONPATH via .bashrc but this is ignored when directly launching it from the "Activities" centre

@paskino
Copy link
Contributor

paskino commented May 24, 2017

I've added the PYTHONPATH variable to the spyder interface. However, that's not sufficient to run the software because all the other environment variables are needed.

@KrisThielemans
Copy link
Member Author

Known problem, see https://lwn.net/Articles/709769/
Recently fixed https://bugzilla.gnome.org/show_bug.cgi?id=736660 by adding the following to /usr/bin/gnome-session at the start

if [ "x$XDG_SESSION_TYPE" = "xwayland" ] &&
   [ "x$XDG_SESSION_CLASS" != "xgreeter" ] &&
   [  -n "$SHELL" ] &&
   grep -q "$SHELL" /etc/shells &&
   ! (echo "$SHELL" | grep -q "false") &&
   ! (echo "$SHELL" | grep -q "nologin"); then
  if [ "$1" != '-l' ]; then
    exec bash -c "exec -l '$SHELL' -c '$0 -l $*'"
  else
    shift
  fi
fi

we should do this (with a note to check when upgrading to a later ubuntu...).
Or does a "apt-get upgrade" already fix this?

@KrisThielemans KrisThielemans added this to the 0.9.1 milestone Jun 7, 2017
@KrisThielemans KrisThielemans modified the milestones: 0.9.1, v1.0.0 Sep 21, 2017
@paskino
Copy link
Contributor

paskino commented Jan 22, 2018

Just tried to add the code in the /usr/bin/gnome-session and start spyder from the Activities and got the ImportError: No module named pSTIR meaning that the trick doesn't seem to work.

@KrisThielemans
Copy link
Member Author

ok. let's postpone this then. I'll reassign to v1.1

@NikEfth
Copy link
Member

NikEfth commented Jan 23, 2018

Have you actually tried to export in the ~/.profile. That is the proper file for this usage.
Before seeing the changes logout.

@NikEfth
Copy link
Member

NikEfth commented Jan 23, 2018

In addition, appropriate would be a .sh in the /etc/profile.d/ if it needs to be system-wide

@KrisThielemans
Copy link
Member Author

~/.profile is a good idea. /etc/profile.d/ is probably overkill in a VM with a single user.

@DANAJK
Copy link
Contributor

DANAJK commented Apr 22, 2018

but it is set in /home/sirfuser/devel/install/bin/env_ccppetmr.sh
which is sourced from ~/.sirfrc
which is sourced from ./bashrc

I think it is wrong because the value of $PYTHONPATH ends with a trailing ':' possibly due to it being created by pre-pending to an unset variable:
PYTHONPATH=/home/sirfuser/devel/install/python:$PYTHONPATH

@casperdcl
Copy link
Member

clearly dash doesn't source .bashrc then. But this should be fixed when we switch to setup.py and/or conda.

@KrisThielemans
Copy link
Member Author

just a reminder that spyder should be ok when run from the command line

@KrisThielemans
Copy link
Member Author

This would be resolved once we use setup.py as opposed to PYTHONPATH. Therefore postponing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants