Possible to run script/setup as non-privileged user? (i.e., not root)

Trying to figure out how to get the full blown dev setup going for the purposes of being able to run tox and so forth, so I can actually submit code … is there a simple solution to be able to get things set up without having to run the script/setup as root? Is there a reason not to just edit the script/* files to run pip with --user ? (i.e., something else will also not work)

So far I haven’t gotten past it trying to pip install things because I’m running it as a non-privileged user.

You should use a virtual environment. Read about it here under “Setting up virtual environment”:

Thanks, that solved it. As someone relatively new to Python this was not obviously the solution, I didn’t see any mention of anything along the lines of "if you can’t or don’t want to setup your environment as root, then you should … " - but maybe I just missed it?

Well I got further, but I’m running into an odd issue where during lint process either temperusb==1.5.3 or thingspeak==0.4.1 fails to install, with an error something like the following:

Collecting temperusb==1.5.3 (from -r /home/devuser/ha/home-assistant/requirements_all.txt (line 922))
  Downloading temperusb-1.5.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-jx__xkc9/temperusb/setup.py", line 10, in <module>
        long_description=open('README.md').read(),
      File "/home/devuser/ha/home-assistant/.tox/lint/lib64/python3.4/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 2304: ordinal not in range(128)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-jx__xkc9/temperusb/

ERROR: could not install deps [-r/home/devuser/ha/home-assistant/requirements_all.txt, -r/home/devuser/ha/home-assistant/requirements_test.txt, -c/home/devuser/ha/home-assistant/homeassistant/package_constraints.txt]; v = InvocationError('/usr/bin/env LANG=C.UTF-8 pip install -r/home/devuser/ha/home-assistant/requirements_all.txt -r/home/devuser/ha/home-assistant/requirements_test.txt -c/home/devuser/ha/home-assistant/homeassistant/package_constraints.txt (see /home/devuser/ha/home-assistant/.tox/lint/log/lint-1.log)', 1)

It seems to be random which one fails, and I’ve tried this on two different systems. If I activate the tox venv’s for each python version I can install them just fine, but linting will still fail with that error.

This could be a bug in something because both module’ setup.py specify that they are utf-8 encoded README’s, so ASCII failing to process is not necessarily surprising …

However I would expect things to fail the same way every time if that’s the case. It seems non-deterministic. Is the order in which modules are installed during this process supposed to be non-deterministic?

Spun up a Debian Jessie VM and seems to work there (minus some new errors about typing: commands failed). So there’s something that doesn’t work about CentOS 7, it seems.