2

The same problem as here; still something else is missing.

Install:

$ sudo pacman -S python-virtualenvwrapper
...
$ which virtualenvwrapper.sh
/usr/bin/virtualenvwrapper.sh

~/.profile:

export WORKON_HOME=~/.virtualenvs
source /usr/bin/virtualenvwrapper.sh

Sourcing it:

$ source .profile 
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/premkproject
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/postmkproject
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/initialize
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/premkvirtualenv
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/postmkvirtualenv
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/prermvirtualenv
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/postrmvirtualenv
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/predeactivate
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/postdeactivate
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/preactivate
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/postactivate
virtualenvwrapper.user_scripts creating /home/alexey/.virtualenvs/get_env_details
[alexey@stovepipebox ~]$ workon
[alexey@stovepipebox ~]$

Everything looks fine; unfortunately, any other session won't see the wrapper commands. After relogin they are still invisible. What am I doing wrong?

UPD:

pacman modified my .bashrc; I just had to uncomment source /usr/bin/virtualenvwrapper.sh statement in .bashrc, then

$ source .bashrc

It's Arch specific.

Alexey Orlov
  • 2,412
  • 3
  • 27
  • 46
  • Which shell are you using? Is it configured to source `.profile` when you log in? – tripleee Apr 01 '19 at 06:43
  • `bash`. How do I have to check the sourcing on login? I can only tell that everything else in `.profile` logs in well. – Alexey Orlov Apr 01 '19 at 06:45
  • A simple diagnostic is to `echo` something from `.profile` and see if it appears in you teminal when you log in. Bash will prefer `.bash_profile` if that exists; a comron arrangement is to source `.profile` from `.bash_profile`; but remember that `.profile` s used by other shells too (so you should use the standard syntax `.` (dot) instead of the Bash-only alias `source` within that file). – tripleee Apr 01 '19 at 06:54
  • `export variable=value` is also not POSIX; you want `variable=value; export variable` – tripleee Apr 01 '19 at 06:55
  • Semicolon, however proper, can't be the root of all evil, I hope. Yes, there is something wrong with echoing: `EDITOR` does not look as expected, for instance. Probably, I need a proper policy on using `.bashrc` and `.profile`. I remember that I had to use `.profile` once because `.bashrc` won't do. Clearly I lack understanding. – Alexey Orlov Apr 01 '19 at 07:09
  • Try moving this code to `.bash_profile` for a start. As indicated above, if you have other code in `.profile` which should be shared between shells, also make sure to `source .profile` from `.bash_profile`. – tripleee Apr 01 '19 at 07:16
  • I will have to create `.bash_profile` first. Would it interfere with `.bashrc`? – Alexey Orlov Apr 01 '19 at 07:20
  • As discussed in [the manual](https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html#Bash-Startup-Files) you *probably* want to `source .bashrc` from `.bash_profile` for consistency. – tripleee Apr 01 '19 at 07:24
  • Thanks! I'm going to research it. Meanwhile, I should have paid more attention to detail: the package manager modified `.bashrc`; I just had to uncomment the `source /usr/bin/virtualenvwrapper.sh` statement in `.bashrc`. – Alexey Orlov Apr 01 '19 at 07:33

0 Answers0