WebFaction
Community site: login faq

Hello

I am using Pycharm IDE for Django site development. As of now, I was using in development phase and was using the local runserver , but soon I would be in production mode (hence I purchased Webfaction hosting)

What is the best way to configure the remote python interpreter in Pycharm IDE for working with Webcation?

Should I use a Vagrant/virtualbox? or use the remote interepreter?

I configured the remote interpreter settings option in Pycharm to web451.webfaction.com, port 22 via SFTP

And the python interpreter automatically detected was : /usr/bin/python Pycharm helpers were installed at : /home/somghosh/.pycharm_helpers

However the problems that show up are : The Pycharm Remote Interpreter config tool says : Pip not found. Install pip. upon clicking the link to install, it asks me for a master password. I provide the password of my Webfaction account and the error msg is:

*Install package failed. 
The following command was executed:
\tmp\tmpl_X74wpycharm-management\pip-1.4.1\setup.py install
The error output of the command:
somghosh is not in the sudoers file.  This incident will be reported.*

Also, a lot of the code-suggestion features in Pycharm is not working - I think because Pycharm can't find the Django libraries can't be detected by Pycharm IDE on the remote server (Webfaction server)

Thanks for the advice.

asked 13 May '14, 20:52

dowjones123
013
accept rate: 0%

edited 13 May '14, 21:13

seanf
12.2k41836


You should use the remote interpreter.

First, SSH into your server and install pip manually:

mkdir -p ~/lib/python2.7
easy_install-2.7 pip

Then edit your .bashrc to add your Django app's library directory to the PYTHONPATH:

export PYTHONPATH=$HOME/webapps/whatever/lib/python2.7

(Note: this is generally not a good thing to do if you are running multiple Django apps, since it can put one app's library directory ahead of another's in the Python search path. Do not keep this setting when you are not actively working on your site with PyCharm.)

Then, configure PyCharm to use the remote interpreter, specifying /usr/local/bin/python2.7 as the interpreter (assuming you're using Python 2.7 for your Django app).

When the configuration is complete, your Django libraries will be detected.

Hope that helps!

permanent link

answered 16 May '14, 00:57

seanf
12.2k41836
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×12
×5
×3

question asked: 13 May '14, 20:52

question was seen: 2,879 times

last updated: 16 May '14, 00:57

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM