1

I installed Anaconda with Python, added some more packages and tried to run Django development python manage.py runserver 0.0.0.0. It's running fine but I can't access it remotely from some reason. My server on other port is working fine and firewalls are all set. I found others had this problem and they simply run it as superuser sudo python manage.py runserver 0.0.0.0.

My problem is that when running as superuser, it will use different Python (or at least that's what it looks like). It is same 2.7.12 version (but no Anaconda suffix) and there are no required packages, so I can't run server.

I'm not really experienced with Linux. I tried to remove Python from root and passing env variables, but that didn't help. How can I run python as superuser and use Python with packages from my user.

8
  • As far as I understand, Anaconda is installed in your home (~/anaconda) by default. root is not allowed to read your home directory. Thus, you cannot easily use your Anaconda installation as root user. Commented Nov 10, 2016 at 14:44
  • It is installed at home. Should I reinstall it, and at which location? Commented Nov 10, 2016 at 14:47
  • I never actually used Anaconda, so I don't feel qualified to give a complete answer about its proper usage. Generally, root is not allowed to access your home, so if you want to be able to run Anaconda as root, you should probably install it in a directory, everyone can access, as for example /opt/ or /usr/local/bin (see: stackoverflow.com/a/27364203/6614295) Commented Nov 10, 2016 at 14:51
  • I think you should use this stackoverflow.com/documentation/django/200/… Commented Nov 10, 2016 at 15:30
  • @Ixer While this is probably a good idea, will this fix the problem of differing python environments as root? He would have to have the environment in place accessible to root anyway, isn't it? Commented Nov 10, 2016 at 15:34

1 Answer 1

1

Try sudo running your local python, like

sudo /home/YourAnaconda_bin/python manage.py runserver 0.0.0.0
Sign up to request clarification or add additional context in comments.

1 Comment

jotasi solution worked for me, but this looks like much simpler solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.