paulscherrerinstitute / pcaspy

Portable Channel Access Server in Python
BSD 3-Clause "New" or "Revised" License
32 stars 24 forks source link

Environment variables not found when installing with pip #27

Closed dmichel76 closed 7 years ago

dmichel76 commented 7 years ago

Hi,

I've just tried installing from pip on my ubuntu machine but, although both environment variables EPICS_BASE and EPICS_HOST_ARCH are set (in my .bashrc file), the setup.py install script cannot see them.

Doing a os.environ.get("EPICS_BASE") directly on the python console results in the correct path being returned.

Any thoughts?

dmichel76 commented 7 years ago

For some reasons, I need to do a "sudo -E" on Ubuntu 14 to carry the environment variables whereas it's not needed on Ubuntu 16...

xiaoqiangwang commented 7 years ago

I intended to suggest the -E flag, but then I saw you said the problem had gone by itself... Anyway whether the environment variables should be kept is set in /etc/sudoers. https://help.ubuntu.com/community/Sudoers The setting is either _envreset or _envkeep.