Configuring Eclipse/PyDev to work with projects on remote server and remote interpreter (workarounds and pitfalls)

北城以北 提交于 2019-12-11 10:16:42

问题


I have the following set up:

  1. Ubuntu 16.04-64 on host;
  2. LXC container running Ubuntu 16.04-64 connected through ssh;
  3. several django projects (pure django, django-cms, wagtail cms) located in separate dirs in the container inside /home/username/dir1, dir2, dir3;
  4. each project dir has separate /env folder which holds virtualenv environments (dir1/env, dir2/env, dir3/env).

I am trying to set up Eclipse(4.8.0) / PyDev(v.6.4.4.2018...) IDE on host to work on these projects. So far I came to the following solution:

  1. created ssh connection to container through RSE tools and imported each project dir (dir1, dir2, dir3) as PyDev Python projects to my workspace;
  2. mounted the entire container fs to the local dir on host (using instructions from user https://askubuntu.com/users/700824/pnti, given here https://askubuntu.com/questions/412477/mount-remote-directory-using-ssh#412478);
  3. provided path to python interpreters inside env folders and usr/lib/pythonX.X folders (in mounted container fs dir) through Properties > PyDev - Interpreter/Grammar settings.

PyDev complains about not finding some *.py files inside /site-packages dir. I've checked manually - all the files seem to be there. "Packages" tab (first tab inside interpreter config window) is empty (cannot load data from provided directories including pip tools). “Libraries” and “Forced builtins” tabs seem to be ok. According to my understanding virtualenv copies all packages to the environment and leaves no links to the base install.

Questions: 1. Is it just PyDev wrong error message or there is a chance that something is really missing in the env folder? 2. Why pip tools were not found? 3. Is it critical? I don't need pip integration and django integration - only debugging and code analysis functioning properly. 4. Is there an easy way to test it?

Thank you!

P.S.: I've read information from these questions:

  1. Define remote interpreter on remote Linux machine using Pydev and RSE Server;
  2. Eclipse PyDev use remote interpreter;
  3. Eclipse: connect to custom python interpreter with PyDev;
  4. https://askubuntu.com/questions/412477/mount-remote-directory-using-ssh#412478

来源:https://stackoverflow.com/questions/51693969/configuring-eclipse-pydev-to-work-with-projects-on-remote-server-and-remote-inte

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!